REB Class Reference

Inheritance diagram for REB:

Inheritance graph
[legend]
Collaboration diagram for REB:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 100 of file reb.h.


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 Setup ()
 Initialize the driver.
virtual int Shutdown ()
 Finalize the driver.
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
timeval last_position
bool refresh_last_position
int last_lpos
int last_rpos
int last_x_f
int last_y_f
double last_theta
timeval last_pos_update
timeval last_power_update
timeval last_ir_update
int pos_update_period
int current_heading
short desired_heading
int ir_sequence
timeval last_ir
bool motors_enabled
bool velocity_mode
bool direct_velocity_control
char reb_serial_port [MAX_FILENAME_SIZE]
pollfd write_pfd read_pfd
short last_trans_command
short last_rot_command
int leftvel
int rightvel
int leftpos
int rightpos

Member Function Documentation

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.

Reimplemented from Driver.

Definition at line 415 of file reb.cc.

References ConfigPosPID(), ConfigSpeedPID(), ConfigSpeedProfile(), ir_subscriptions, PLAYER_MSGTYPE_DATA, position_subscriptions, ProcessCommand(), Driver::ProcessMessages(), UBotRobotParams_t::PulsesPerMMMS, SetIRState(), SetOdometry(), SetSpeed(), and UpdateData().

Here is the call graph for this function:

int REB::Setup (  )  [virtual]

Initialize the driver.

This function is called with the first client subscribes; it MUST be implemented by the driver.

Returns:
Returns 0 on success.

Implements Driver.

Definition at line 296 of file reb.cc.

References desired_heading, direct_velocity_control, motors_enabled, read_pfd, reb_fd, refresh_last_position, SetIRState(), and velocity_mode.

Here is the call graph for this function:

int REB::Shutdown (  )  [virtual]

Finalize the driver.

This function is called with the last client unsubscribes; it MUST be implemented by the driver.

Returns:
Returns 0 on success.

Implements Driver.

Definition at line 351 of file reb.cc.

References reb_fd, SetIRState(), SetSpeed(), and Driver::StopThread().

Here is the call graph for this function:


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

Last updated 12 September 2005 21:38:45