Public Member Functions | |
REB (ConfigFile *cf, int section) | |
virtual void | Main () |
Main method for driver thread. | |
int | ProcessMessage (ClientData *client, player_msghdr *hdr, uint8_t *data, uint8_t *resp_data, size_t *resp_len) |
virtual int | Subscribe (player_device_id_t id) |
virtual int | Unsubscribe (player_device_id_t id) |
virtual int | MainSetup () |
Sets up the resources needed by the driver thread. | |
virtual void | MainQuit () |
Cleanup method for driver thread (called when main exits) | |
void | Restart () |
void | ReadConfig () |
void | SetOdometry (int, int, short) |
void | SetIRState (int) |
void | UpdateData (void) |
void | UpdateIRData (player_ir_data_t *) |
void | UpdatePowerData (player_power_data_t *) |
void | UpdatePosData (player_position_data_t *) |
void | ConfigAD (int, int) |
unsigned short | ReadAD (int) |
void | ReadAllIR (uint16_t *ir) |
void | SetSpeed (int, int) |
int | ReadSpeed (int) |
void | SetPos (int, int) |
void | SetPosCounter (int, int) |
int | ReadPos (int) |
unsigned char | ReadStatus (int, int *, int *) |
void | ConfigPosPID (int, int, int, int) |
void | ConfigSpeedPID (int, int, int, int) |
void | ConfigSpeedProfile (int, int, int) |
Private Member Functions | |
int | write_serial (char *, int) |
int | read_serial_until (char *, int, char *, int) |
int | write_command (char *buf, int len, int maxsize) |
int | ProcessCommand (player_position_cmd_t *poscmd) |
Private Attributes | |
player_device_id_t | ir_id |
player_device_id_t | position_id |
player_device_id_t | power_id |
int | ir_subscriptions |
int | position_subscriptions |
int | param_index |
int | reb_fd |
struct timeval | last_position |
bool | refresh_last_position |
int | last_lpos |
int | last_rpos |
int | last_x_f |
int | last_y_f |
double | last_theta |
struct timeval | last_pos_update |
struct timeval | last_power_update |
struct timeval | last_ir_update |
int | pos_update_period |
int | current_heading |
short | desired_heading |
int | ir_sequence |
struct timeval | last_ir |
bool | motors_enabled |
bool | velocity_mode |
bool | direct_velocity_control |
char | reb_serial_port [MAX_FILENAME_SIZE] |
struct pollfd write_pfd | read_pfd |
short | last_trans_command |
short | last_rot_command |
int | leftvel |
int | rightvel |
int | leftpos |
int | rightpos |
void REB::Main | ( | ) | [virtual] |
Main method for driver thread.
drivers have their own thread of execution, created using StartThread(); this is the entry point for the driver thread, and must be overloaded by all threaded drivers.
Implements ThreadedDriver.
References PLAYER_MSGTYPE_DATA, and Driver::ProcessMessages().
void REB::MainQuit | ( | void | ) | [virtual] |
Cleanup method for driver thread (called when main exits)
Overload this method and to do additional cleanup when the driver thread exits.
Reimplemented from ThreadedDriver.