|
Position2DProxy Class Reference
[Proxies]
#include <playerclient.h>
Inherits ClientProxy.
List of all members.
Detailed Description
The Position2DProxy class is used to control a position2d device. The latest position data is contained in the attributes xpos, ypos, etc.
|
Public Member Functions |
| Position2DProxy (PlayerClient *pc, unsigned short index, unsigned char access='c') |
int | SetSpeed (double xspeed, double yspeed, double yawspeed) |
int | SetSpeed (double speed, double turnrate) |
int | GoTo (double x, double y, double yaw) |
int | SetMotorState (unsigned char state) |
int | SelectVelocityControl (unsigned char mode) |
int | ResetOdometry () |
int | SelectPositionMode (unsigned char mode) |
int | SetOdometry (double x, double y, double yaw) |
int | SetSpeedPID (double kp, double ki, double kd) |
| Only supported by the reb_position driver.
|
int | SetPositionPID (double kp, double ki, double kd) |
| Only supported by the reb_position driver.
|
int | SetPositionSpeedProfile (double spd, double acc) |
int | DoStraightLine (double m) |
| Only supported by the reb_position driver.
|
int | DoRotation (double yawspeed) |
| Only supported by the reb_position driver.
|
int | DoDesiredHeading (double yaw, double xspeed, double 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 | Yaw () const |
| Accessor method.
|
double | Speed () const |
| Accessor method.
|
double | SideSpeed () const |
| Accessor method.
|
double | TurnRate () const |
| Accessor method.
|
double | XSpeed () const |
| Accessor method.
|
double | YSpeed () const |
| Accessor method.
|
double | YawSpeed () 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.
|
Constructor & Destructor Documentation
Position2DProxy::Position2DProxy |
( |
PlayerClient * |
pc, |
|
|
unsigned short |
index, |
|
|
unsigned char |
access = 'c' |
|
) |
[inline] |
|
|
Constructor. Leave the access field empty to start unconnected. |
Member Function Documentation
int Position2DProxy::SetSpeed |
( |
double |
xspeed, |
|
|
double |
yspeed, |
|
|
double |
yawspeed |
|
) |
|
|
|
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 Position2DProxy::SetSpeed |
( |
double |
speed, |
|
|
double |
turnrate |
|
) |
[inline] |
|
|
Same as the previous SetSpeed(), but doesn't take the yspeed speed (so use this one for non-holonomic robots). |
int Position2DProxy::GoTo |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
yaw |
|
) |
|
|
|
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 Position2DProxy::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 Position2DProxy::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 Position2DProxy::ResetOdometry |
( |
|
) |
|
|
|
Reset odometry to (0,0,0). Returns: 0 if everything's ok, -1 otherwise. |
int Position2DProxy::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 Position2DProxy::SetOdometry |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
yaw |
|
) |
|
|
|
Sets the odometry to the pose (x, y, yaw). Note that x and y are in m and yaw is in radians. Returns: 0 if OK, -1 else |
int Position2DProxy::SetSpeedPID |
( |
double |
kp, |
|
|
double |
ki, |
|
|
double |
kd |
|
) |
|
|
|
Only supported by the reb_position driver.
|
int Position2DProxy::SetPositionPID |
( |
double |
kp, |
|
|
double |
ki, |
|
|
double |
kd |
|
) |
|
|
|
Only supported by the reb_position driver.
|
int Position2DProxy::SetPositionSpeedProfile |
( |
double |
spd, |
|
|
double |
acc |
|
) |
|
|
|
Only supported by the reb_position driver. spd rad/s, acc rad/s/s |
int Position2DProxy::DoStraightLine |
( |
double |
m |
) |
|
|
|
Only supported by the reb_position driver.
|
int Position2DProxy::DoRotation |
( |
double |
yawspeed |
) |
|
|
|
Only supported by the reb_position driver.
|
int Position2DProxy::DoDesiredHeading |
( |
double |
yaw, |
|
|
double |
xspeed, |
|
|
double |
yawspeed |
|
) |
|
|
|
Only supported by the reb_position driver.
|
int Position2DProxy::SetStatus |
( |
uint8_t |
cmd, |
|
|
uint16_t |
value |
|
) |
|
|
|
Only supported by the segwayrmp driver.
|
int Position2DProxy::PlatformShutdown |
( |
|
) |
|
|
|
Only supported by the segwayrmp driver.
|
double Position2DProxy::Xpos |
( |
|
) |
const [inline] |
|
double Position2DProxy::Ypos |
( |
|
) |
const [inline] |
|
double Position2DProxy::Yaw |
( |
|
) |
const [inline] |
|
double Position2DProxy::Speed |
( |
|
) |
const [inline] |
|
double Position2DProxy::SideSpeed |
( |
|
) |
const [inline] |
|
double Position2DProxy::TurnRate |
( |
|
) |
const [inline] |
|
double Position2DProxy::XSpeed |
( |
|
) |
const [inline] |
|
double Position2DProxy::YSpeed |
( |
|
) |
const [inline] |
|
double Position2DProxy::YawSpeed |
( |
|
) |
const [inline] |
|
unsigned char Position2DProxy::Stall |
( |
|
) |
const [inline] |
|
void Position2DProxy::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 Position2DProxy::Print |
( |
|
) |
[virtual] |
|
|
Print current position device state.
Reimplemented from ClientProxy. |
The documentation for this class was generated from the following file:
Generated on Tue May 3 14:16:05 2005 for Player by 1.3.6
|