P2OS Class Reference

Inheritance diagram for P2OS:

Inheritance graph
[legend]
Collaboration diagram for P2OS:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 180 of file p2os.h.


Public Member Functions

 P2OS (ConfigFile *cf, int section)
 ~P2OS (void)
virtual int Subscribe (player_devaddr_t id)
 Subscribe to this driver.
virtual int Unsubscribe (player_devaddr_t id)
 Unsubscribe from this driver.
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 CMUcamReset (bool doLock=true)
void CMUcamTrack (int rmin=0, int rmax=0, int gmin=0, int gmax=0, int bmin=0, int bmax=0)
void CMUcamStartTracking (bool doLock=true)
void CMUcamStopTracking (bool doLock=true)

Private Member Functions

int SendReceive (P2OSPacket *pkt, bool publish_data=true)
void ResetRawPositions ()
void ToggleSonarPower (unsigned char val)
void ToggleMotorPower (unsigned char val)
int HandleConfig (QueuePointer &resp_queue, player_msghdr *hdr, void *data)
int HandleCommand (player_msghdr *hdr, void *data)
void StandardSIPPutData (double timestampStandardSIP)
void GyroPutData (double timestampGyro)
void BlobfinderPutData (double timestampSERAUX)
void ActarrayPutData (double timestampArm)
void HandlePositionCommand (player_position2d_cmd_vel_t position_cmd)
int HandleGripperCommand (player_msghdr *hdr, void *data)
int HandleLiftCommand (player_msghdr *hdr, void *data)
int HandleArmGripperCommand (player_msghdr *hdr, void *data)
void HandleAudioCommand (player_audio_sample_item_t audio_cmd)
void OpenGripper (void)
void CloseGripper (void)
void StopGripper (void)
void OpenArmGripper (void)
void CloseArmGripper (void)
void StopArmGripper (void)
double TicksToDegrees (int joint, unsigned char ticks)
unsigned char DegreesToTicks (int joint, double degrees)
double TicksToRadians (int joint, unsigned char ticks)
unsigned char RadiansToTicks (int joint, double rads)
double RadsPerSectoSecsPerTick (int joint, double speed)
double SecsPerTicktoRadsPerSec (int joint, double secs)
void ToggleActArrayPower (unsigned char val, bool lock=true)
void SetActArrayJointSpeed (int joint, double speed)
void HandleActArrayPosCmd (player_actarray_position_cmd_t cmd)
void HandleActArrayHomeCmd (player_actarray_home_cmd_t cmd)
int HandleActArrayCommand (player_msghdr *hdr, void *data)
void HandleLimbHomeCmd (void)
void HandleLimbStopCmd (void)
void HandleLimbSetPoseCmd (player_limb_setpose_cmd_t cmd)
void HandleLimbSetPositionCmd (player_limb_setposition_cmd_t cmd)
void HandleLimbVecMoveCmd (player_limb_vecmove_cmd_t cmd)
int HandleLimbCommand (player_msghdr *hdr, void *data)
void SendPulse (void)

Private Attributes

player_p2os_data_t p2os_data
player_devaddr_t position_id
player_devaddr_t sonar_id
player_devaddr_t aio_id
player_devaddr_t dio_id
player_devaddr_t gripper_id
player_devaddr_t lift_id
player_devaddr_t bumper_id
player_devaddr_t power_id
player_devaddr_t compass_id
player_devaddr_t gyro_id
player_devaddr_t blobfinder_id
player_devaddr_t audio_id
player_devaddr_t actarray_id
player_devaddr_t limb_id
player_devaddr_t armgripper_id
bool sentGripperCmd
uint8_t lastGripperCmd
uint8_t lastLiftCmd
player_actarray_position_cmd_t lastLiftPosCmd
bool sentArmGripperCmd
uint8_t lastArmGripperCmd
uint8_t lastActArrayCmd
player_actarray_position_cmd_t lastActArrayPosCmd
player_actarray_home_cmd_t lastActArrayHomeCmd
bool sent_audio_cmd
player_audio_sample_item_t last_audio_cmd
int rot_kp
int rot_kv
int rot_ki
int trans_kp
int trans_kv
int trans_ki
int position_subscriptions
int sonar_subscriptions
int actarray_subscriptions
SIPsippacket
player_pose3d_t gripperPose
player_bbox3d_t gripperOuterSize
player_bbox3d_t gripperInnerSize
player_bbox3d_t armGripperOuterSize
player_bbox3d_t armGripperInnerSize
double aaLengths [6]
double aaOrients [18]
double aaAxes [18]
player_point_3d_t aaBasePos
player_orientation_3d_t aaBaseOrient
KineCalckineCalc
float armOffsetX
float armOffsetY
float armOffsetZ
player_limb_data_t limb_data
int param_idx
int direct_wheel_vel_control
int psos_fd
const char * psos_serial_port
bool psos_use_tcp
const char * psos_tcp_host
int psos_tcp_port
timeval lastblob_tv
int motor_max_speed
int motor_max_turnspeed
bool use_vel_band
short motor_max_trans_accel
short motor_max_trans_decel
short motor_max_rot_accel
short motor_max_rot_decel
int radio_modemp
int joystickp
int bumpstall
float pulse
double lastPulseTime

Member Function Documentation

int P2OS::Subscribe ( player_devaddr_t  id  )  [virtual]

Subscribe to this driver.

The Subscribe() and Unsubscribe() methods are used to control subscriptions to the driver; a driver MAY override them, but usually won't.

Parameters:
addr Address of the device to subscribe to (the driver may have more than one interface).
Returns:
Returns 0 on success.

Reimplemented from Driver.

Definition at line 1329 of file p2os.cc.

References actarray_subscriptions, Device::MatchDeviceAddress(), position_subscriptions, sonar_subscriptions, and Driver::Subscribe().

Here is the call graph for this function:

int P2OS::Unsubscribe ( player_devaddr_t  id  )  [virtual]

Unsubscribe from this driver.

The Subscribe() and Unsubscribe() methods are used to control subscriptions to the driver; a driver MAY override them, but usually won't.

Parameters:
addr Address of the device to unsubscribe from (the driver may have more than one interface).
Returns:
Returns 0 on success.

Reimplemented from Driver.

Definition at line 1353 of file p2os.cc.

References actarray_subscriptions, Device::MatchDeviceAddress(), position_subscriptions, sonar_subscriptions, and Driver::Unsubscribe().

Here is the call graph for this function:

void P2OS::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 1516 of file p2os.cc.

References actarray_subscriptions, P2OSPacket::Build(), lastblob_tv, lastPulseTime, Driver::Lock(), position_subscriptions, Driver::ProcessMessages(), ResetRawPositions(), SendPulse(), SendReceive(), sonar_subscriptions, ToggleActArrayPower(), ToggleMotorPower(), ToggleSonarPower(), and Driver::Unlock().

Here is the call graph for this function:

int P2OS::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 679 of file p2os.cc.

References SIP::angle_offset, P2OSPacket::Build(), CMUcamReset(), motor_max_rot_accel, motor_max_trans_accel, P2OSPacket::packet, param_idx, PLAYER_ERROR1, PLAYER_MSG1, psos_fd, P2OSPacket::Receive(), rot_ki, rot_kp, rot_kv, P2OSPacket::Send(), SendReceive(), sippacket, ToggleSonarPower(), trans_ki, trans_kp, trans_kv, SIP::x_offset, and SIP::y_offset.

Here is the call graph for this function:

int P2OS::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 1274 of file p2os.cc.

References P2OSPacket::Build(), psos_fd, P2OSPacket::Send(), sippacket, and Driver::StopThread().

Here is the call graph for this function:

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

Message handler.

This function is called once for each message in the incoming queue. Reimplement it to provide message handling. Return 0 if you handled the message and -1 otherwise

Parameters:
resp_queue The queue to which any response should go.
hdr The message header
data The message body

Reimplemented from Driver.

Definition at line 2094 of file p2os.cc.

References actarray_id, armgripper_id, gripper_id, lift_id, limb_id, PLAYER_ACTARRAY_CMD_HOME, PLAYER_ACTARRAY_CMD_MULTI_POS, PLAYER_ACTARRAY_CMD_POS, PLAYER_ACTARRAY_REQ_GET_GEOM, PLAYER_ACTARRAY_REQ_POWER, PLAYER_ACTARRAY_REQ_SPEED, PLAYER_GRIPPER_CMD_CLOSE, PLAYER_GRIPPER_CMD_OPEN, PLAYER_GRIPPER_CMD_STOP, PLAYER_LIMB_CMD_HOME, PLAYER_LIMB_CMD_SETPOSE, PLAYER_LIMB_CMD_STOP, PLAYER_LIMB_REQ_GEOM, PLAYER_LIMB_REQ_POWER, PLAYER_MSGTYPE_CMD, PLAYER_MSGTYPE_REQ, PLAYER_POSITION2D_CMD_VEL, position_id, and player_msghdr::type.


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

Last updated 12 September 2005 21:38:45