ER Class Reference

Inheritance diagram for ER:

Inheritance graph
[legend]
Collaboration diagram for ER:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 93 of file er.h.


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 Setup ()
 Initialize the driver.
virtual int Shutdown ()
 Finalize the driver.
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.

Reimplemented from Driver.

Definition at line 747 of file er.cc.

References _axle_length, _pa, _px, _py, _resting, _stopped, GetOdom(), player_pose2d::pa, PLAYER_MSGTYPE_DATA, PLAYER_POSITION2D_DATA_STATE, player_position2d_data::pos, position_id, Driver::ProcessMessages(), Driver::Publish(), player_pose2d::px, player_pose2d::py, player_position2d_data::stall, UpdateOdom(), and player_position2d_data::vel.

Here is the call graph for this function:

int ER::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 408 of file er.cc.

References _fd, _fd_blocking, _odom_initialized, _pa, _px, _py, _serial_port, InitOdom(), and InitRobot().

Here is the call graph for this function:

int ER::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 497 of file er.cc.

References _debug, _fd, SetVelocity(), and Driver::StopThread().

Here is the call graph for this function:

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


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

Last updated 12 September 2005 21:38:45