next up previous contents
Next: 2.15 PowerProxy Up: 2. Class Reference Previous: 2.13 PositionProxy   Contents

Subsections

2.14 Position3DProxy

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

Attributes

double xpos,ypos,zpos;
double roll,pitch,yaw;

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

double xspeed, yspeed, zspeed;
double rollspeed, pitchspeed, yawspeed;

Robot speeds in m/sec, rad/sec

unsigned char stall;

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

Methods

Position3DProxy(PlayerClient* pc, unsigned short index,
unsigned char access ='c')

Constructor. Leave the access field empty to start unconnected.

int SetSpeed(double xspeed, double yspeed, double yawspeed)

Send a motor command for a planar robot. Specify the forward, sideways, and angular speeds in mm/s, mm/s, and degrees/sec, respectively. Returns: 0 if everything's ok, -1 otherwise.

int SetSpeed(double xspeed, double yawspeed)

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

int SetMotorState(unsigned char state)

Enable/disable the motors

void Print()

Print current position device state.

double  Xpos()

Accessor method

double  Ypos()

Accessor method

double  Zpos()

Accessor method

double  Roll()

Accessor method

double  Pitch()

Accessor method

double  Yaw()

Accessor method

double  XSpeed()

Accessor method

double  YSpeed()

Accessor method

double  ZSpeed()

Accessor method

double  RollSpeed()

Accessor method

double  PitchSpeed()

Accessor method

double  YawSpeed()

Accessor method

unsigned char Stall ()

Accessor method


next up previous contents
Next: 2.15 PowerProxy Up: 2. Class Reference Previous: 2.13 PositionProxy   Contents
2004-05-31