|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavaclient.PlayerDevice
javaclient.AbstractPositionDevice
javaclient.Position2DInterface
public class Position2DInterface
The position2d interface is used to control a planar mobile robot base. This interface is the same as the position interface, but uses different units (e.g., mrad instead of deg). The position2d interface will probably replace the position interface (eventually).
| Fields inherited from class javaclient.PlayerDevice |
|---|
device, DIFFERENCE_SYNCH_FACTOR, index, is, os, pc, PLAYER_MAX_REQREP_SIZE, PLAYER_STXX, reserved, size, t_sec, t_usec, ts_sec, ts_usec |
| Constructor Summary | |
|---|---|
Position2DInterface(PlayerClient pc,
short indexOfDevice)
Constructor for Position2DInterface. |
|
| Method Summary | |
|---|---|
PlayerPosition2DGeomT |
getGeom()
Get the geometry data. |
byte |
getStall()
Get motors status. |
int |
getX()
Get X position in mm. |
int |
getXSpeed()
Get X translational velocity in mm/sec. |
int |
getY()
Get Y position in mm. |
int |
getYaw()
Get Heading in mrad. |
int |
getYawSpeed()
Get angular velocity in mrad/sec. |
int |
getYSpeed()
Get Y translational velocity in mm/sec. |
void |
handleEARMessage()
Handle Error Acknowledgement Response messages. |
void |
handleNARMessage()
Handle Negative Acknowledgement Response messages. |
void |
handleResponse(int size)
Handle acknowledgement response messages (threaded mode). |
boolean |
isGeomReady()
Check if geometry data is available. |
void |
queryGeometry()
Configuration request: Query geometry. |
void |
readData()
Read the position data values (xPos, yPos, yaw, xSpeed, ySpeed, yawSpeed, stalls). |
void |
resetOdometry()
Configuration request: Reset odometry. |
void |
setControlMode(int mode)
Configuration request: Change position control. |
void |
setMotorPower(int state)
Configuration request: Motor power. |
void |
setOdometry(int xT,
int yT,
int theta)
Configuration request: Set odometry. |
void |
setPosition(int xP,
int yP,
int yawT)
Send position commands. |
void |
setPosition(int xP,
int yP,
int yawT,
int xS,
int yS,
int yawS,
byte state,
byte type)
The position interface accepts new positions and/or velocities for the robot's motors (drivers may support position control, speed control or both). |
void |
setPositionPIDParams(int kp,
int ki,
int kd)
Configuration request: Set position PID parameters. |
void |
setSpeed(int speed,
int turnrate)
Set speed and turnrate. |
void |
setSpeed(int speed,
int turnrate,
int sideSpeed)
Set speed, turnrate and sideSpeed. |
void |
setSpeedProfileParams(int sp,
int acc)
Configuration request: Set speed profile parameters. |
void |
setVelocityControl(byte mode)
Configuration request: Change velocity control. |
void |
setVelocityPIDParams(int kp,
int ki,
int kd)
Configuration request: Set velocity PID parameters. |
| Methods inherited from class javaclient.PlayerDevice |
|---|
getTimeForDataSampled_sec, getTimeForDataSampled_usec, getTimeForDataSampled, getTimeForDataSent_sec, getTimeForDataSent_usec, getTimeForDataSent, readHeader, sendHeader |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final short PLAYER_POSITION2D_GET_GEOM_REQ
protected final short PLAYER_POSITION2D_MOTOR_POWER_REQ
protected final short PLAYER_POSITION2D_VELOCITY_MODE_REQ
protected final short PLAYER_POSITION2D_RESET_ODOM_REQ
protected final short PLAYER_POSITION2D_POSITION_MODE_REQ
protected final short PLAYER_POSITION2D_SPEED_PID_REQ
protected final short PLAYER_POSITION2D_POSITION_PID_REQ
protected final short PLAYER_POSITION2D_SPEED_PROF_REQ
protected final short PLAYER_POSITION2D_SET_ODOM_REQ
protected final short PLAYER_POSITION2D_RMP_VELOCITY_SCALE
protected final short PLAYER_POSITION2D_RMP_ACCEL_SCALE
protected final short PLAYER_POSITION2D_RMP_TURN_SCALE
protected final short PLAYER_POSITION2D_RMP_GAIN_SCHEDULE
protected final short PLAYER_POSITION2D_RMP_CURRENT_LIMIT
protected final short PLAYER_POSITION2D_RMP_RST_INTEGRATORS
protected final short PLAYER_POSITION2D_RMP_SHUTDOWN
protected final short PLAYER_POSITION_RMP_RST_INT_RIGHT
protected final short PLAYER_POSITION_RMP_RST_INT_LEFT
protected final short PLAYER_POSITION_RMP_RST_INT_YAW
protected final short PLAYER_POSITION_RMP_RST_INT_FOREAFT
| Constructor Detail |
|---|
public Position2DInterface(PlayerClient pc,
short indexOfDevice)
pc - a reference to the PlayerClient objectindexOfDevice - the index of the device| Method Detail |
|---|
public void readData()
readData in class PlayerDevicepublic int getX()
getX in class AbstractPositionDevicepublic int getY()
getY in class AbstractPositionDevicepublic int getYaw()
getYaw in class AbstractPositionDevicepublic byte getStall()
public int getXSpeed()
public int getYSpeed()
public int getYawSpeed()
public void setPosition(int xP,
int yP,
int yawT,
int xS,
int yS,
int yawS,
byte state,
byte type)
xP - X position2d in mmyP - Y position2d in mmyawT - Yaw in mradxS - X translational velocity in mm/secyS - Y translational velocity in mm/secyawS - angular velocity in mrad/secstate - motor state (zero is either off or locked, depending on the driver)type - command type; 0 = velocity, 1 = position
public void setPosition(int xP,
int yP,
int yawT)
xP - X position in mmyP - Y position in mmyawT - Yaw in mrad
public void setSpeed(int speed,
int turnrate)
setSpeed in class AbstractPositionDevicespeed - X translational velocity in mm/secturnrate - angular velocity in mrad/sec
public void setSpeed(int speed,
int turnrate,
int sideSpeed)
speed - X translational velocity in mm/secturnrate - angular velocity in mrad/secsideSpeed - Y translational velocity in mm/secpublic void queryGeometry()
public boolean isGeomReady()
public PlayerPosition2DGeomT getGeom()
public void handleResponse(int size)
handleResponse in class PlayerDevicesize - size of the payloadpublic void setMotorPower(int state)
state - 0 for off, 1 for onpublic void setVelocityControl(byte mode)
mode - driver-specific modepublic void resetOdometry()
public void setControlMode(int mode)
mode - 0 for velocity mode, 1 for position mode
public void setOdometry(int xT,
int yT,
int theta)
xT - X in mmyT - Y in mmtheta - Heading in mrad
public void setVelocityPIDParams(int kp,
int ki,
int kd)
kp - P parameterki - I parameterkd - D parameter
public void setPositionPIDParams(int kp,
int ki,
int kd)
kp - P parameterki - I parameterkd - D parameter
public void setSpeedProfileParams(int sp,
int acc)
sp - max speedacc - max accelerationpublic void handleNARMessage()
handleNARMessage in class PlayerDevicepublic void handleEARMessage()
handleEARMessage in class PlayerDevice
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||