28 MRP2_Serial(std::string port_name, uint32_t baudrate = 38400, std::string mode =
"8N1",
bool simple =
true);
29 MRP2_Serial(uint16_t vendor_id, uint16_t product_id,
int ep_in_addr,
int ep_out_addr,
bool simple =
true);
31 void set_speeds(int32_t left_speed, int32_t right_speed);
144 int send_and_get_reply(uint8_t _command, uint8_t *send_array,
int send_size,
bool is_ack);
146 int process(uint8_t *inData,
int recievedData, uint8_t _command_to_read);
147 int process_simple (uint8_t *inData,
int recievedData, uint8_t _command_to_read);
150 int _speed_l,
_speed_r,
_imax_l,
_imax_r,
_maxspeed_fwd,
_maxspeed_rev,
_maxaccel,
_batt_volt,
_batt_current,
_batt_soc,
_batt_cell_capacity,
_bumper_estop,
_estop_btn;
void set_estop(bool value)
void set_param_pid(char side, char param, float value)
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val)
void set_param_imax(char side, uint32_t value)
void set_read_timeout(double timeout)
int send_and_get_reply(uint8_t _command, uint8_t *send_array, int send_size, bool is_ack)
milvus::SerialComm serial_port
int get_batt_volt(bool update=false)
void clear_diag(int diag)
bool _diag_aux_lights_err
int get_maxaccel(bool update=false)
std::vector< int > get_sonars(bool update=false)
void set_speed_l(int32_t left_speed)
int get_speed_r(bool update=false)
std::vector< int > _sonars
int get_batt_current(bool update=false)
void set_maxspeed_rev(uint32_t value)
int process_simple(uint8_t *inData, int recievedData, uint8_t _command_to_read)
int first_validator(uint8_t *buf)
void set_speed_r(int32_t right_speed)
bool get_estop(bool update=false)
void set_speeds(int32_t left_speed, int32_t right_speed)
bool checksum_match(uint8_t *buf, int size)
MRP2_Serial(std::string port_name, uint32_t baudrate=38400, std::string mode="8N1", bool simple=true)
int get_speed_l(bool update=false)
std::vector< int > get_positions(bool update=false)
void array_chopper(uint8_t *buf, int start, int end)
int get_position_r(bool update=false)
void set_max_accel(uint32_t value)
void print_array(uint8_t *buf, int length)
bool get_estop_button(bool update=false)
double get_read_timeout(void)
int execute_command(uint8_t *buf)
std::vector< int > _positions
int process(uint8_t *inData, int recievedData, uint8_t _command_to_read)
bool get_bumper_estop(bool update=false)
bool _get_ack(serial_t command)
int second_validator(uint8_t *buf, int data_len)
int get_position_l(bool update=false)
unsigned char checksum(int size)
void set_bumper_estop(bool value)
std::vector< int > get_speeds(bool update=false)
int get_maxspeed_rev(bool update=false)
int get_batt_soc(bool update=false)
std::vector< int > _bumpers
unsigned char checksum_check_array(uint8_t *arr, int size)
int read_serial(uint8_t _command_to_read)
int find_message_start(uint8_t *buf, int lastIndex)
int get_batt_cell_capacity(bool update=false)
std::vector< int > get_param_imax(char side, bool update=false)
bool _diag_motor_drvr_err
void set_maxspeed_fwd(uint32_t value)
float get_param_pid(char side, char param, bool update=false)
std::vector< int > get_bumpers(bool update=false)
std::vector< int > _speeds
int get_maxspeed_fwd(bool update=false)