|
MotorProxy Class Reference
[Proxies]
#include <playerclient.h>
Inherits ClientProxy.
List of all members.
Detailed Description
The MotorProxy class is used to control a motor device. The latest motor data is contained in the attributes theta , thetaspeed , etc.
Constructor & Destructor Documentation
MotorProxy::MotorProxy |
( |
PlayerClient * |
pc, |
|
|
unsigned short |
index, |
|
|
unsigned char |
access = 'c' |
|
) |
[inline] |
|
|
Constructor. Leave the access field empty to start unconnected. |
Member Function Documentation
int MotorProxy::SetSpeed |
( |
double |
speed |
) |
|
|
|
Send a motor command for velocity control mode. Specify the angular speeds in rad/s. Returns: 0 if everything's ok, -1 otherwise. |
int MotorProxy::GoTo |
( |
double |
angle |
) |
|
|
|
Send a motor command for position control mode. Specify the desired angle of the motor in radians. Returns: 0 if everything's ok, -1 otherwise. |
int MotorProxy::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 MotorProxy::SelectVelocityControl |
( |
unsigned char |
mode |
) |
|
|
|
Select velocity control mode. The motor state is typically device independent. This is where you can potentially choose between different types of control methods (PD, PID, etc) Returns: 0 if everything's ok, -1 otherwise. |
int MotorProxy::ResetOdometry |
( |
|
) |
|
|
|
Reset odometry to (0,0,0). Returns: 0 if everything's ok, -1 otherwise. |
int MotorProxy::SetOdometry |
( |
double |
angle |
) |
|
|
|
Sets the odometry to the pose (theta). Note that theta is in radians. Returns: 0 if OK, -1 else |
int MotorProxy::SelectPositionMode |
( |
unsigned char |
mode |
) |
|
|
|
Select position mode on the motor driver. Set mode for 0 for velocity mode, 1 for position mode. Returns: 0 if OK, -1 else |
int MotorProxy::SetSpeedPID |
( |
double |
kp, |
|
|
double |
ki, |
|
|
double |
kd |
|
) |
|
|
|
Set the PID parameters of the motor for use in velocity control mode Returns: 0 if OK, -1 else |
int MotorProxy::SetPositionPID |
( |
double |
kp, |
|
|
double |
ki, |
|
|
double |
kd |
|
) |
|
|
|
Set the PID parameters of the motor for use in position control mode Returns: 0 if OK, -1 else |
int MotorProxy::SetPositionSpeedProfile |
( |
double |
spd, |
|
|
double |
acc |
|
) |
|
|
|
Set the ramp profile of the motor when in position control mode spd is in rad/s and acc is in rad/s/s Returns: 0 if OK, -1 else |
double MotorProxy::Theta |
( |
|
) |
const [inline] |
|
double MotorProxy::ThetaSpeed |
( |
|
) |
const [inline] |
|
unsigned char MotorProxy::Stall |
( |
|
) |
const [inline] |
|
void MotorProxy::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 MotorProxy::Print |
( |
|
) |
[virtual] |
|
|
Print current motor device state.
Reimplemented from ClientProxy. |
The documentation for this class was generated from the following file:
Generated on Tue May 3 14:15:52 2005 for Player by 1.3.6
|