PlayerCc::Position1dProxy Class Reference

The Position1dProxy class is used to control a position1d device. More...

#include <playerc++.h>

Inheritance diagram for PlayerCc::Position1dProxy:
Collaboration diagram for PlayerCc::Position1dProxy:

List of all members.


Detailed Description

The Position1dProxy class is used to control a position1d device.

The latest position data is contained in the attributes pos, vel , etc.

Public Member Functions

 Position1dProxy (PlayerClient *aPc, uint32_t aIndex=0)
 Constructor.
 ~Position1dProxy ()
 Destructor.
void SetSpeed (double aVel)
 Send a motor command for velocity control mode.
void GoTo (double aPos, double aVel)
 Send a motor command for position control mode.
void RequestGeom ()
 Get the device's geometry; it is read into the relevant class attributes.
player_pose3d_t GetPose () const
 Accessor for the pose (fill it in by calling RequestGeom)
player_bbox3d_t GetSize () const
 Accessor for the size (fill it in by calling RequestGeom)
void SetMotorEnable (bool enable)
 Enable/disable the motors.
void SetOdometry (double aPos)
 Sets the odometry to the pose aPos.
void ResetOdometry ()
 Reset odometry to 0.
double GetPos () const
 Get current position.
double GetVel () const
 Get current velocity.
bool GetStall () const
 Get whether or not the device is stalled.
uint8_t GetStatus () const
 Get device status.
bool IsLimitMin () const
 Is the device at the min limit?
bool IsLimitCen () const
 Is the device at the center limit?
bool IsLimitMax () const
 Is the device at the max limit?
bool IsOverCurrent () const
 Is the device over current limits?
bool IsTrajComplete () const
 Is the device finished moving?
bool IsEnabled () const
 Is the device enabled?

Private Member Functions

void Subscribe (uint32_t aIndex)
void Unsubscribe ()

Private Attributes

playerc_position1d_tmDevice

Member Function Documentation

void PlayerCc::Position1dProxy::GoTo ( double  aPos,
double  aVel 
)

Send a motor command for position control mode.

Specify the desired pose of the robot in [m] or [rad] desired motion in [m/s] or [rad/s]

void PlayerCc::Position1dProxy::RequestGeom ( )

Get the device's geometry; it is read into the relevant class attributes.

void PlayerCc::Position1dProxy::SetMotorEnable ( bool  enable)

Enable/disable the motors.

Set state to 0 to disable or 1 to enable. Be VERY careful with this method! Your robot is likely to run across the room with the charger still attached.

void PlayerCc::Position1dProxy::SetOdometry ( double  aPos)

Sets the odometry to the pose aPos.

Note:
aPos is in either [m] or [rad] depending on the actuator type
void PlayerCc::Position1dProxy::SetSpeed ( double  aVel)

Send a motor command for velocity control mode.

Specify the forward, sideways, and angular speeds in m/sec, m/sec, and radians/sec, respectively.


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