ros2_rover
Loading...
Searching...
No Matches
lx16a::LX16A Class Reference

#include <lx16a.hpp>

Collaboration diagram for lx16a::LX16A:

Public Member Functions

 LX16A (std::string serial_port, unsigned int baud_rate)
 
uint8_t lower_byte (int value)
 
uint8_t higher_byte (int value)
 
uint8_t word (int low, int high)
 
int clamp (int range_min, int range_max, int value)
 
uint8_t get_servo_id (uint8_t servo_id)
 
void set_servo_id (uint8_t servo_id, uint8_t new_servo_id)
 
void move (uint8_t servo_id, int position, int time=0)
 
void move_prepare (uint8_t servo_id, int position, int time=0)
 
void move_start (uint8_t servo_id=SERVO_ID_ALL)
 
void move_stop (uint8_t servo_id=SERVO_ID_ALL)
 
std::vector< uint8_t > get_prepared_move (uint8_t servo_id)
 
int get_position_offset (uint8_t servo_id)
 
std::vector< uint8_t > get_position_limits (int8_t servo_id)
 
int get_position (uint8_t servo_id)
 
void set_position_offset (uint8_t servo_id, int deviation)
 
void save_position_offset (uint8_t servo_id)
 
void set_position_limits (uint8_t servo_id, int min_position, int max_position)
 
std::vector< uint8_t > get_voltage_limits (uint8_t servo_id)
 
uint8_t get_voltage (uint8_t servo_id)
 
void set_voltage_limits (uint8_t servo_id, int min_voltage, int max_voltage)
 
uint8_t get_max_temperature_limit (uint8_t servo_id)
 
uint8_t get_temperature (uint8_t servo_id)
 
void set_max_temperature_limit (uint8_t servo_id, int max_temperature)
 
uint8_t get_mode (uint8_t servo_id)
 
int get_motor_speed (uint8_t servo_id)
 
void set_servo_mode (uint8_t servo_id)
 
void set_motor_mode (uint8_t servo_id, int speed=0)
 
bool is_motor_on (uint8_t servo_id)
 
void motor_on (uint8_t servo_id)
 
void motor_off (uint8_t servo_id)
 
bool is_led_on (uint8_t servo_id)
 
void led_on (uint8_t servo_id)
 
void led_off (uint8_t servo_id)
 
uint8_t get_led_errors (uint8_t servo_id)
 
void set_led_errors (uint8_t servo_id, uint8_t error)
 

Private Member Functions

void send_command (uint8_t servo_id, uint8_t command, std::vector< uint8_t > params)
 
std::vector< uint8_t > wait_for_response (uint8_t servo_id, uint8_t command)
 
std::vector< uint8_t > query (uint8_t servo_id, uint8_t command)
 

Private Attributes

std::unique_ptr< Serialserial
 
std::unique_ptr< std::mutex > mtx
 

Constructor & Destructor Documentation

◆ LX16A()

LX16A::LX16A ( std::string serial_port,
unsigned int baud_rate )

Member Function Documentation

◆ clamp()

int LX16A::clamp ( int range_min,
int range_max,
int value )

◆ get_led_errors()

uint8_t LX16A::get_led_errors ( uint8_t servo_id)

◆ get_max_temperature_limit()

uint8_t LX16A::get_max_temperature_limit ( uint8_t servo_id)

◆ get_mode()

uint8_t LX16A::get_mode ( uint8_t servo_id)

◆ get_motor_speed()

int LX16A::get_motor_speed ( uint8_t servo_id)

◆ get_position()

int LX16A::get_position ( uint8_t servo_id)

◆ get_position_limits()

std::vector< uint8_t > LX16A::get_position_limits ( int8_t servo_id)

◆ get_position_offset()

int LX16A::get_position_offset ( uint8_t servo_id)

◆ get_prepared_move()

std::vector< uint8_t > LX16A::get_prepared_move ( uint8_t servo_id)

◆ get_servo_id()

uint8_t LX16A::get_servo_id ( uint8_t servo_id)

◆ get_temperature()

uint8_t LX16A::get_temperature ( uint8_t servo_id)

◆ get_voltage()

uint8_t LX16A::get_voltage ( uint8_t servo_id)

◆ get_voltage_limits()

std::vector< uint8_t > LX16A::get_voltage_limits ( uint8_t servo_id)

◆ higher_byte()

uint8_t LX16A::higher_byte ( int value)

◆ is_led_on()

bool LX16A::is_led_on ( uint8_t servo_id)

◆ is_motor_on()

bool LX16A::is_motor_on ( uint8_t servo_id)

◆ led_off()

void LX16A::led_off ( uint8_t servo_id)

◆ led_on()

void LX16A::led_on ( uint8_t servo_id)

◆ lower_byte()

uint8_t LX16A::lower_byte ( int value)

◆ motor_off()

void LX16A::motor_off ( uint8_t servo_id)

◆ motor_on()

void LX16A::motor_on ( uint8_t servo_id)

◆ move()

void LX16A::move ( uint8_t servo_id,
int position,
int time = 0 )

◆ move_prepare()

void LX16A::move_prepare ( uint8_t servo_id,
int position,
int time = 0 )

◆ move_start()

void LX16A::move_start ( uint8_t servo_id = SERVO_ID_ALL)

◆ move_stop()

void LX16A::move_stop ( uint8_t servo_id = SERVO_ID_ALL)

◆ query()

std::vector< uint8_t > LX16A::query ( uint8_t servo_id,
uint8_t command )
private

◆ save_position_offset()

void LX16A::save_position_offset ( uint8_t servo_id)

◆ send_command()

void LX16A::send_command ( uint8_t servo_id,
uint8_t command,
std::vector< uint8_t > params )
private

◆ set_led_errors()

void LX16A::set_led_errors ( uint8_t servo_id,
uint8_t error )

◆ set_max_temperature_limit()

void LX16A::set_max_temperature_limit ( uint8_t servo_id,
int max_temperature )

◆ set_motor_mode()

void LX16A::set_motor_mode ( uint8_t servo_id,
int speed = 0 )

◆ set_position_limits()

void LX16A::set_position_limits ( uint8_t servo_id,
int min_position,
int max_position )

◆ set_position_offset()

void LX16A::set_position_offset ( uint8_t servo_id,
int deviation )

◆ set_servo_id()

void LX16A::set_servo_id ( uint8_t servo_id,
uint8_t new_servo_id )

◆ set_servo_mode()

void LX16A::set_servo_mode ( uint8_t servo_id)

◆ set_voltage_limits()

void LX16A::set_voltage_limits ( uint8_t servo_id,
int min_voltage,
int max_voltage )

◆ wait_for_response()

std::vector< uint8_t > LX16A::wait_for_response ( uint8_t servo_id,
uint8_t command )
private

◆ word()

uint8_t LX16A::word ( int low,
int high )

Member Data Documentation

◆ mtx

std::unique_ptr<std::mutex> lx16a::LX16A::mtx
private

◆ serial

std::unique_ptr<Serial> lx16a::LX16A::serial
private

The documentation for this class was generated from the following files: