ER Class Reference
Inheritance diagram for ER:
Collaboration diagram for ER:

List of all members.

Public Member Functions

 ER (ConfigFile *cf, int section)
int SetVelocity (double lvel, double rvel)
void Stop (int StopMode)
virtual void Main ()
 Main method for driver thread.
virtual int MainSetup ()
 Sets up the resources needed by the driver thread.
virtual void MainQuit ()
 Cleanup method for driver thread (called when main exits)
virtual int ProcessMessage (QueuePointer &resp_queue, player_msghdr *hdr, void *data)
 Message handler.
void Test ()

Private Member Functions

int InitOdom ()
int InitRobot ()
int WriteBuf (unsigned char *s, size_t len)
int ReadBuf (unsigned char *s, size_t len)
int SendCommand (unsigned char *cmd, int cmd_len, unsigned char *ret_val, int ret_len)
int checksum_ok (unsigned char *buf, int len)
int ComputeTickDiff (int from, int to)
int ChangeMotorState (int state)
int BytesToInt32 (unsigned char *ptr)
float BytesToFloat (unsigned char *ptr)
void UpdateOdom (int ltics, int rtics)
void SpeedCommand (unsigned char address, double speed, int dir)
void SetOdometry (long, long, long)
void ResetOdometry ()
int GetOdom (int *ltics, int *rtics)
int GetBatteryVoltage (int *voltage)
int GetRangeSensor (int s, float *val)
void MotorSpeed ()
int send_command (unsigned char address, unsigned char c, int ret_num, unsigned char *ret)
int send_command_2_arg (unsigned char address, unsigned char c, int arg, int ret_num, unsigned char *ret)
int send_command_4_arg (unsigned char address, unsigned char c, int arg, int ret_num, unsigned char *ret)

Private Attributes

player_er1_data_t er1_data
player_devaddr_t position_id
int position_subscriptions
int * _tc_num
int _fd
const char * _serial_port
bool _fd_blocking
double _axle_length
int _motor_0_dir
int _motor_1_dir
bool _debug
bool _need_to_set_speed
bool _odom_initialized
bool _stopped
int _last_ltics
int _last_rtics
double _px
double _py
double _pa
int _powered
int _resting

Member Function Documentation

void ER::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_pose2d::pa, PLAYER_MSGTYPE_DATA, PLAYER_POSITION2D_DATA_STATE, player_position2d_data::pos, Driver::ProcessMessages(), Driver::Publish(), player_pose2d::px, player_pose2d::py, player_position2d_data::stall, and player_position2d_data::vel.

Here is the call graph for this function:

void ER::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.

int ER::ProcessMessage ( QueuePointer resp_queue,
player_msghdr hdr,
void *  data 
) [virtual]

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