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