P2OS Class Reference
Inheritance diagram for P2OS:Detailed Description
Definition at line 180 of file p2os.h.
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: