Home
FAQ
Player
Stage
Gazebo
Contrib
Documentation
Publications
Contributors
Users

Project
Download
Bugs/Feedback
Mailing lists

Radish

Old news
Old stuff

PositionProxy Class Reference
[Proxies]

#include <playerclient.h>

Inherits ClientProxy.

List of all members.


Detailed Description

The PositionProxy class is used to control a position device. The latest position data is contained in the attributes xpos, ypos, etc.


Public Member Functions

 PositionProxy (PlayerClient *pc, unsigned short index, unsigned char access='c')
int GetGeometry ()
int SetSpeed (double speed, double sidespeed, double turnrate)
int SetSpeed (double speed, double turnrate)
int GoTo (double x, double y, double t)
int SetMotorState (unsigned char state)
int SelectVelocityControl (unsigned char mode)
int ResetOdometry ()
int SelectPositionMode (unsigned char mode)
int SetOdometry (double x, double y, double t)
int SetSpeedPID (int kp, int ki, int kd)
 Only supported by the reb_position driver.

int SetPositionPID (short kp, short ki, short kd)
 Only supported by the reb_position driver.

int SetPositionSpeedProfile (short spd, short acc)
 Only supported by the reb_position driver.

int DoStraightLine (int mm)
 Only supported by the reb_position driver.

int DoRotation (int deg)
 Only supported by the reb_position driver.

int DoDesiredHeading (int theta, int xspeed, int yawspeed)
 Only supported by the reb_position driver.

int SetStatus (uint8_t cmd, uint16_t value)
 Only supported by the segwayrmp driver.

int PlatformShutdown ()
 Only supported by the segwayrmp driver.

double Xpos () const
 Accessor method.

double Ypos () const
 Accessor method.

double Theta () const
 Accessor method.

double Speed () const
 Accessor method.

double SideSpeed () const
 Accessor method.

double TurnRate () const
 Accessor method.

unsigned char Stall () const
 Accessor method.

void FillData (player_msghdr_t hdr, const char *buffer)
void Print ()
 Print current position device state.


Public Attributes

double pose [3]
double size [2]
double xpos
 Robot pose (according to odometry) in m, m, radians.

double ypos
 Robot pose (according to odometry) in m, m, radians.

double theta
 Robot pose (according to odometry) in m, m, radians.

double speed
 Robot speeds in m/sec, m/sec, radians/sec.

double sidespeed
 Robot speeds in m/sec, m/sec, radians/sec.

double turnrate
 Robot speeds in m/sec, m/sec, radians/sec.

unsigned char stall
 Stall flag: 1 if the robot is stalled and 0 otherwise.


Constructor & Destructor Documentation

PositionProxy::PositionProxy PlayerClient pc,
unsigned short  index,
unsigned char  access = 'c'
[inline]
 

Constructor. Leave the access field empty to start unconnected.


Member Function Documentation

int PositionProxy::GetGeometry  ) 
 

Get the position geometry. Writes the result into the proxy (pose and size).

int PositionProxy::SetSpeed double  speed,
double  sidespeed,
double  turnrate
 

Send a motor command for velocity control mode. Specify the forward, sideways, and angular speeds in m/sec, m/sec, and radians/sec, respectively. Returns: 0 if everything's ok, -1 otherwise.

int PositionProxy::SetSpeed double  speed,
double  turnrate
[inline]
 

Same as the previous SetSpeed(), but doesn't take the sideways speed (so use this one for non-holonomic robots).

int PositionProxy::GoTo double  x,
double  y,
double  t
 

Send a motor command for position control mode. Specify the desired pose of the robot in m, m, radians. Returns: 0 if everything's ok, -1 otherwise.

int PositionProxy::SetMotorState unsigned char  state  ) 
 

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. Returns: 0 if everything's ok, -1 otherwise.

int PositionProxy::SelectVelocityControl unsigned char  mode  ) 
 

Select velocity control mode.

For the the p2os_position driver, set mode to 0 for direct wheel velocity control (default), or 1 for separate translational and rotational control.

For the reb_position driver: 0 is direct velocity control, 1 is for velocity-based heading PD controller (uses DoDesiredHeading()).

Returns: 0 if everything's ok, -1 otherwise.

int PositionProxy::ResetOdometry  ) 
 

Reset odometry to (0,0,0). Returns: 0 if everything's ok, -1 otherwise.

int PositionProxy::SelectPositionMode unsigned char  mode  ) 
 

Select position mode on the reb_position driver. Set mode for 0 for velocity mode, 1 for position mode. Returns: 0 if OK, -1 else

int PositionProxy::SetOdometry double  x,
double  y,
double  t
 

Sets the odometry to the pose (x, y, theta). Note that x and y are in m and theta is in radians. Returns: 0 if OK, -1 else

int PositionProxy::SetSpeedPID int  kp,
int  ki,
int  kd
 

Only supported by the reb_position driver.

int PositionProxy::SetPositionPID short  kp,
short  ki,
short  kd
 

Only supported by the reb_position driver.

int PositionProxy::SetPositionSpeedProfile short  spd,
short  acc
 

Only supported by the reb_position driver.

int PositionProxy::DoStraightLine int  mm  ) 
 

Only supported by the reb_position driver.

int PositionProxy::DoRotation int  deg  ) 
 

Only supported by the reb_position driver.

int PositionProxy::DoDesiredHeading int  theta,
int  xspeed,
int  yawspeed
 

Only supported by the reb_position driver.

int PositionProxy::SetStatus uint8_t  cmd,
uint16_t  value
 

Only supported by the segwayrmp driver.

int PositionProxy::PlatformShutdown  ) 
 

Only supported by the segwayrmp driver.

double PositionProxy::Xpos  )  const [inline]
 

Accessor method.

double PositionProxy::Ypos  )  const [inline]
 

Accessor method.

double PositionProxy::Theta  )  const [inline]
 

Accessor method.

double PositionProxy::Speed  )  const [inline]
 

Accessor method.

double PositionProxy::SideSpeed  )  const [inline]
 

Accessor method.

double PositionProxy::TurnRate  )  const [inline]
 

Accessor method.

unsigned char PositionProxy::Stall  )  const [inline]
 

Accessor method.

void PositionProxy::FillData player_msghdr_t  hdr,
const char *  buffer
[virtual]
 

All proxies must provide this method. It is used internally to parse new data when it is received.

Reimplemented from ClientProxy.

void PositionProxy::Print  )  [virtual]
 

Print current position device state.

Reimplemented from ClientProxy.


Member Data Documentation

double PositionProxy::pose[3]
 

Robot geometry in robot cs: pose gives the position and orientation, size gives the extent. These values are filled in by GetGeometry().

double PositionProxy::size[2]
 

double PositionProxy::xpos
 

Robot pose (according to odometry) in m, m, radians.

double PositionProxy::ypos
 

Robot pose (according to odometry) in m, m, radians.

double PositionProxy::theta
 

Robot pose (according to odometry) in m, m, radians.

double PositionProxy::speed
 

Robot speeds in m/sec, m/sec, radians/sec.

double PositionProxy::sidespeed
 

Robot speeds in m/sec, m/sec, radians/sec.

double PositionProxy::turnrate
 

Robot speeds in m/sec, m/sec, radians/sec.

unsigned char PositionProxy::stall
 

Stall flag: 1 if the robot is stalled and 0 otherwise.


The documentation for this class was generated from the following file:
Generated on Tue May 3 14:16:05 2005 for Player by doxygen 1.3.6