javaclient2
Class Position3DInterface
java.lang.Object
javaclient2.PlayerDevice
javaclient2.AbstractPositionDevice
javaclient2.Position3DInterface
- All Implemented Interfaces:
- PlayerConstants
public class Position3DInterface
- extends AbstractPositionDevice
The position3d interface is used to control mobile robot bases in
3D (i.e., pitch and roll are important).
- Version:
- v2.0 - Player 2.0 supported
- Author:
- Radu Bogdan Rusu
Fields inherited from interface javaclient2.structures.PlayerConstants |
MCOM_CHANNEL_LEN, MCOM_DATA_BUFFER_SIZE, MCOM_DATA_LEN, MCOM_N_BUFS, PLAYER_ACTARRAY_ACTSTATE_BRAKED, PLAYER_ACTARRAY_ACTSTATE_IDLE, PLAYER_ACTARRAY_ACTSTATE_MOVING, PLAYER_ACTARRAY_ACTSTATE_STALLED, PLAYER_ACTARRAY_BRAKES_REQ, PLAYER_ACTARRAY_CODE, PLAYER_ACTARRAY_DATA_STATE, PLAYER_ACTARRAY_GET_GEOM_REQ, PLAYER_ACTARRAY_HOME_CMD, PLAYER_ACTARRAY_NUM_ACTUATORS, PLAYER_ACTARRAY_POS_CMD, PLAYER_ACTARRAY_POWER_REQ, PLAYER_ACTARRAY_SPEED_CMD, PLAYER_ACTARRAY_SPEED_REQ, PLAYER_ACTARRAY_STRING, PLAYER_ACTARRAY_TYPE_LINEAR, PLAYER_ACTARRAY_TYPE_ROTARY, PLAYER_AIO_CMD_STATE, PLAYER_AIO_CODE, PLAYER_AIO_DATA_STATE, PLAYER_AIO_MAX_INPUTS, PLAYER_AIO_MAX_OUTPUTS, PLAYER_AIO_STRING, PLAYER_AUDIO_CODE, PLAYER_AUDIO_COMMAND_BUFFER_SIZE, PLAYER_AUDIO_DATA_BUFFER_SIZE, PLAYER_AUDIO_PAIRS, PLAYER_AUDIO_STRING, PLAYER_AUDIODSP_CODE, PLAYER_AUDIODSP_DATA_TONES, PLAYER_AUDIODSP_GET_CONFIG, PLAYER_AUDIODSP_MAX_BITSTRING_LEN, PLAYER_AUDIODSP_MAX_FREQS, PLAYER_AUDIODSP_PLAY_CHIRP, PLAYER_AUDIODSP_PLAY_TONE, PLAYER_AUDIODSP_REPLAY, PLAYER_AUDIODSP_SET_CONFIG, PLAYER_AUDIODSP_STRING, PLAYER_AUDIOMIXER_CODE, PLAYER_AUDIOMIXER_GET_LEVELS, PLAYER_AUDIOMIXER_SET_IGAIN, PLAYER_AUDIOMIXER_SET_LINE, PLAYER_AUDIOMIXER_SET_MASTER, PLAYER_AUDIOMIXER_SET_MIC, PLAYER_AUDIOMIXER_SET_OGAIN, PLAYER_AUDIOMIXER_SET_PCM, PLAYER_AUDIOMIXER_STRING, PLAYER_BLINKENLIGHT_CMD_COLOR, PLAYER_BLINKENLIGHT_CMD_DUTYCYCLE, PLAYER_BLINKENLIGHT_CMD_PERIOD, PLAYER_BLINKENLIGHT_CMD_POWER, PLAYER_BLINKENLIGHT_CMD_STATE, PLAYER_BLINKENLIGHT_CODE, PLAYER_BLINKENLIGHT_DATA_STATE, PLAYER_BLINKENLIGHT_STRING, PLAYER_BLOBFINDER_CODE, PLAYER_BLOBFINDER_DATA_BLOBS, PLAYER_BLOBFINDER_MAX_BLOBS, PLAYER_BLOBFINDER_REQ_SET_COLOR, PLAYER_BLOBFINDER_REQ_SET_IMAGER_PARAMS, PLAYER_BLOBFINDER_STRING, PLAYER_BUMPER_CODE, PLAYER_BUMPER_DATA_GEOM, PLAYER_BUMPER_DATA_STATE, PLAYER_BUMPER_GET_GEOM, PLAYER_BUMPER_MAX_SAMPLES, PLAYER_BUMPER_STRING, PLAYER_CAMERA_CODE, PLAYER_CAMERA_COMPRESS_JPEG, PLAYER_CAMERA_COMPRESS_RAW, PLAYER_CAMERA_DATA_STATE, PLAYER_CAMERA_FORMAT_MONO16, PLAYER_CAMERA_FORMAT_MONO8, PLAYER_CAMERA_FORMAT_RGB565, PLAYER_CAMERA_FORMAT_RGB888, PLAYER_CAMERA_IMAGE_HEIGHT, PLAYER_CAMERA_IMAGE_SIZE, PLAYER_CAMERA_IMAGE_WIDTH, PLAYER_CAMERA_STRING, PLAYER_CLOSE_MODE, PLAYER_DATAMODE_PULL, PLAYER_DATAMODE_PUSH, PLAYER_DIO_CMD_VALUES, PLAYER_DIO_CODE, PLAYER_DIO_DATA_VALUES, PLAYER_DIO_STRING, PLAYER_ENERGY_CODE, PLAYER_ENERGY_DATA_STATE, PLAYER_ENERGY_SET_CHARGING_POLICY_REQ, PLAYER_ENERGY_STRING, PLAYER_ERROR_MODE, PLAYER_FIDUCIAL_CODE, PLAYER_FIDUCIAL_DATA_SCAN, PLAYER_FIDUCIAL_MAX_SAMPLES, PLAYER_FIDUCIAL_REQ_GET_FOV, PLAYER_FIDUCIAL_REQ_GET_GEOM, PLAYER_FIDUCIAL_REQ_GET_ID, PLAYER_FIDUCIAL_REQ_SET_FOV, PLAYER_FIDUCIAL_REQ_SET_ID, PLAYER_FIDUCIAL_STRING, PLAYER_GPS_CODE, PLAYER_GPS_DATA_STATE, PLAYER_GPS_STRING, PLAYER_GRAPHICS2D_CMD_CLEAR, PLAYER_GRAPHICS2D_CMD_DRAW, PLAYER_GRAPHICS2D_CMD_POINTS, PLAYER_GRAPHICS2D_CMD_POLYGON, PLAYER_GRAPHICS2D_CMD_POLYLINE, PLAYER_GRAPHICS2D_CODE, PLAYER_GRAPHICS2D_MAX_POINTS, PLAYER_GRAPHICS2D_STRING, PLAYER_GRAPHICS3D_CMD_CLEAR, PLAYER_GRAPHICS3D_CODE, PLAYER_GRAPHICS3D_MAX_POINTS, PLAYER_GRAPHICS3D_STRING, PLAYER_GRIPPER_CMD_STATE, PLAYER_GRIPPER_CODE, PLAYER_GRIPPER_DATA_STATE, PLAYER_GRIPPER_REQ_GET_GEOM, PLAYER_GRIPPER_STRING, PLAYER_HEALTH_CODE, PLAYER_HEALTH_DATA, PLAYER_HEALTH_STRING, PLAYER_IDENT_STRLEN, PLAYER_IMU_CODE, PLAYER_IMU_DATA_CALIB, PLAYER_IMU_DATA_EULER, PLAYER_IMU_DATA_QUAT, PLAYER_IMU_DATA_STATE, PLAYER_IMU_REQ_SET_DATATYPE, PLAYER_IMU_STRING, PLAYER_IR_CODE, PLAYER_IR_DATA_RANGES, PLAYER_IR_MAX_SAMPLES, PLAYER_IR_POSE, PLAYER_IR_POWER, PLAYER_IR_STRING, PLAYER_JOYSTICK_CODE, PLAYER_JOYSTICK_DATA_STATE, PLAYER_JOYSTICK_STRING, PLAYER_KEYLEN, PLAYER_LASER_CODE, PLAYER_LASER_DATA_SCAN, PLAYER_LASER_DATA_SCANPOSE, PLAYER_LASER_MAX_SAMPLES, PLAYER_LASER_REQ_GET_CONFIG, PLAYER_LASER_REQ_GET_GEOM, PLAYER_LASER_REQ_POWER, PLAYER_LASER_REQ_SET_CONFIG, PLAYER_LASER_STRING, PLAYER_LIMB_BRAKES_REQ, PLAYER_LIMB_CODE, PLAYER_LIMB_DATA, PLAYER_LIMB_GEOM_REQ, PLAYER_LIMB_HOME_CMD, PLAYER_LIMB_POWER_REQ, PLAYER_LIMB_SETPOSE_CMD, PLAYER_LIMB_SETPOSITION_CMD, PLAYER_LIMB_SPEED_REQ, PLAYER_LIMB_STATE_BRAKED, PLAYER_LIMB_STATE_COLL, PLAYER_LIMB_STATE_IDLE, PLAYER_LIMB_STATE_MOVING, PLAYER_LIMB_STATE_OOR, PLAYER_LIMB_STOP_CMD, PLAYER_LIMB_STRING, PLAYER_LIMB_VECMOVE_CMD, PLAYER_LOCALIZE_CODE, PLAYER_LOCALIZE_DATA_HYPOTHS, PLAYER_LOCALIZE_MAX_HYPOTHS, PLAYER_LOCALIZE_PARTICLES_MAX, PLAYER_LOCALIZE_REQ_GET_PARTICLES, PLAYER_LOCALIZE_REQ_SET_POSE, PLAYER_LOCALIZE_STRING, PLAYER_LOG_CODE, PLAYER_LOG_REQ_GET_STATE, PLAYER_LOG_REQ_SET_FILENAME, PLAYER_LOG_REQ_SET_READ_REWIND, PLAYER_LOG_REQ_SET_READ_STATE, PLAYER_LOG_REQ_SET_WRITE_STATE, PLAYER_LOG_STRING, PLAYER_LOG_TYPE_READ, PLAYER_LOG_TYPE_WRITE, PLAYER_MAP_CODE, PLAYER_MAP_DATA_INFO, PLAYER_MAP_MAX_SEGMENTS, PLAYER_MAP_MAX_TILE_SIZE, PLAYER_MAP_REQ_GET_DATA, PLAYER_MAP_REQ_GET_INFO, PLAYER_MAP_REQ_GET_VECTOR, PLAYER_MAP_STRING, PLAYER_MAX_DEVICES, PLAYER_MAX_DRIVER_STRING_LEN, PLAYER_MAX_MESSAGE_SIZE, PLAYER_MAX_REQREP_SIZE, PLAYER_MCOM_CLEAR, PLAYER_MCOM_CODE, PLAYER_MCOM_POP, PLAYER_MCOM_PUSH, PLAYER_MCOM_READ, PLAYER_MCOM_SET_CAPACITY, PLAYER_MCOM_STRING, PLAYER_MSGQUEUE_DEFAULT_MAXLEN, PLAYER_MSGTYPE_CMD, PLAYER_MSGTYPE_DATA, PLAYER_MSGTYPE_REQ, PLAYER_MSGTYPE_RESP_ACK, PLAYER_MSGTYPE_RESP_NACK, PLAYER_MSGTYPE_SYNCH, PLAYER_NOMAD_CODE, PLAYER_NOMAD_STRING, PLAYER_NULL_CODE, PLAYER_NULL_STRING, PLAYER_OPAQUE_CODE, PLAYER_OPAQUE_STRING, PLAYER_OPEN_MODE, PLAYER_PLANNER_CMD_GOAL, PLAYER_PLANNER_CODE, PLAYER_PLANNER_DATA_STATE, PLAYER_PLANNER_MAX_WAYPOINTS, PLAYER_PLANNER_REQ_ENABLE, PLAYER_PLANNER_REQ_GET_WAYPOINTS, PLAYER_PLANNER_STRING, PLAYER_PLAYER_CODE, PLAYER_PLAYER_REQ_ADD_REPLACE_RULE, PLAYER_PLAYER_REQ_AUTH, PLAYER_PLAYER_REQ_DATA, PLAYER_PLAYER_REQ_DATAFREQ, PLAYER_PLAYER_REQ_DATAMODE, PLAYER_PLAYER_REQ_DEV, PLAYER_PLAYER_REQ_DEVLIST, PLAYER_PLAYER_REQ_DRIVERINFO, PLAYER_PLAYER_REQ_IDENT, PLAYER_PLAYER_REQ_NAMESERVICE, PLAYER_PLAYER_STRING, PLAYER_POINTCLOUD3D_CODE, PLAYER_POINTCLOUD3D_DATA_STATE, PLAYER_POINTCLOUD3D_MAX_POINTS, PLAYER_POINTCLOUD3D_STRING, PLAYER_POSITION1D_CMD_POS, PLAYER_POSITION1D_CMD_VEL, PLAYER_POSITION1D_CODE, PLAYER_POSITION1D_DATA_GEOM, PLAYER_POSITION1D_DATA_STATE, PLAYER_POSITION1D_REQ_GET_GEOM, PLAYER_POSITION1D_REQ_MOTOR_POWER, PLAYER_POSITION1D_REQ_POSITION_MODE, PLAYER_POSITION1D_REQ_POSITION_PID, PLAYER_POSITION1D_REQ_RESET_ODOM, PLAYER_POSITION1D_REQ_SET_ODOM, PLAYER_POSITION1D_REQ_SPEED_PID, PLAYER_POSITION1D_REQ_SPEED_PROF, PLAYER_POSITION1D_REQ_VELOCITY_MODE, PLAYER_POSITION1D_STATUS_ENABLED, PLAYER_POSITION1D_STATUS_LIMIT_CEN, PLAYER_POSITION1D_STATUS_LIMIT_MAX, PLAYER_POSITION1D_STATUS_LIMIT_MIN, PLAYER_POSITION1D_STATUS_OC, PLAYER_POSITION1D_STATUS_TRAJ_COMPLETE, PLAYER_POSITION1D_STRING, PLAYER_POSITION2D_CMD_CAR, PLAYER_POSITION2D_CMD_POS, PLAYER_POSITION2D_CMD_VEL, PLAYER_POSITION2D_CODE, PLAYER_POSITION2D_DATA_GEOM, PLAYER_POSITION2D_DATA_STATE, PLAYER_POSITION2D_REQ_GET_GEOM, PLAYER_POSITION2D_REQ_MOTOR_POWER, PLAYER_POSITION2D_REQ_POSITION_MODE, PLAYER_POSITION2D_REQ_POSITION_PID, PLAYER_POSITION2D_REQ_RESET_ODOM, PLAYER_POSITION2D_REQ_SET_ODOM, PLAYER_POSITION2D_REQ_SPEED_PID, PLAYER_POSITION2D_REQ_SPEED_PROF, PLAYER_POSITION2D_REQ_VELOCITY_MODE, PLAYER_POSITION2D_STRING, PLAYER_POSITION3D_CMD_SET_POS, PLAYER_POSITION3D_CMD_SET_VEL, PLAYER_POSITION3D_CODE, PLAYER_POSITION3D_DATA_GEOMETRY, PLAYER_POSITION3D_DATA_STATE, PLAYER_POSITION3D_GET_GEOM, PLAYER_POSITION3D_MOTOR_POWER, PLAYER_POSITION3D_POSITION_MODE, PLAYER_POSITION3D_POSITION_PID, PLAYER_POSITION3D_RESET_ODOM, PLAYER_POSITION3D_SET_ODOM, PLAYER_POSITION3D_SPEED_PID, PLAYER_POSITION3D_SPEED_PROF, PLAYER_POSITION3D_STRING, PLAYER_POSITION3D_VELOCITY_MODE, PLAYER_POWER_CODE, PLAYER_POWER_DATA_STATE, PLAYER_POWER_MASK_CHARGING, PLAYER_POWER_MASK_JOULES, PLAYER_POWER_MASK_PERCENT, PLAYER_POWER_MASK_VOLTS, PLAYER_POWER_MASK_WATTS, PLAYER_POWER_SET_CHARGING_POLICY_REQ, PLAYER_POWER_STRING, PLAYER_PTZ_CMD_STATE, PLAYER_PTZ_CODE, PLAYER_PTZ_DATA_GEOM, PLAYER_PTZ_DATA_STATE, PLAYER_PTZ_MAX_CONFIG_LEN, PLAYER_PTZ_POSITION_CONTROL, PLAYER_PTZ_REQ_AUTOSERVO, PLAYER_PTZ_REQ_CONTROL_MODE, PLAYER_PTZ_REQ_GENERIC, PLAYER_PTZ_REQ_GEOM, PLAYER_PTZ_STRING, PLAYER_PTZ_VELOCITY_CONTROL, PLAYER_RFID_CODE, PLAYER_RFID_DATA, PLAYER_RFID_MAX_GUID, PLAYER_RFID_MAX_TAGS, PLAYER_RFID_REQ_LOCKTAG, PLAYER_RFID_REQ_POWER, PLAYER_RFID_REQ_READTAG, PLAYER_RFID_REQ_WRITETAG, PLAYER_RFID_STRING, PLAYER_SERVICE_ADV_CODE, PLAYER_SERVICE_ADV_STRING, PLAYER_SIMULATION_CODE, PLAYER_SIMULATION_IDENTIFIER_MAXLEN, PLAYER_SIMULATION_REQ_GET_POSE2D, PLAYER_SIMULATION_REQ_SET_POSE2D, PLAYER_SIMULATION_STRING, PLAYER_SONAR_CODE, PLAYER_SONAR_DATA_GEOM, PLAYER_SONAR_DATA_RANGES, PLAYER_SONAR_MAX_SAMPLES, PLAYER_SONAR_REQ_GET_GEOM, PLAYER_SONAR_REQ_POWER, PLAYER_SONAR_STRING, PLAYER_SOUND_CMD_IDX, PLAYER_SOUND_CODE, PLAYER_SOUND_STRING, PLAYER_SPEECH_CMD_SAY, PLAYER_SPEECH_CODE, PLAYER_SPEECH_MAX_STRING_LEN, PLAYER_SPEECH_RECOGNITION_CODE, PLAYER_SPEECH_RECOGNITION_STRING, PLAYER_SPEECH_STRING, PLAYER_TRUTH_CODE, PLAYER_TRUTH_DATA_FIDUCIAL_ID, PLAYER_TRUTH_DATA_POSE, PLAYER_TRUTH_REQ_GET_FIDUCIAL_ID, PLAYER_TRUTH_REQ_SET_FIDUCIAL_ID, PLAYER_TRUTH_REQ_SET_POSE, PLAYER_TRUTH_STRING, PLAYER_WAVEFORM_CODE, PLAYER_WAVEFORM_DATA_MAX, PLAYER_WAVEFORM_DATA_SAMPLE, PLAYER_WAVEFORM_STRING, PLAYER_WIFI_CODE, PLAYER_WIFI_DATA_STATE, PLAYER_WIFI_IWSPY_ADD, PLAYER_WIFI_IWSPY_DEL, PLAYER_WIFI_IWSPY_PING, PLAYER_WIFI_MAC, PLAYER_WIFI_MAX_LINKS, PLAYER_WIFI_MODE_ADHOC, PLAYER_WIFI_MODE_AUTO, PLAYER_WIFI_MODE_INFRA, PLAYER_WIFI_MODE_MASTER, PLAYER_WIFI_MODE_REPEAT, PLAYER_WIFI_MODE_SECOND, PLAYER_WIFI_MODE_UNKNOWN, PLAYER_WIFI_QUAL_DBM, PLAYER_WIFI_QUAL_REL, PLAYER_WIFI_QUAL_UNKNOWN, PLAYER_WIFI_STRING, PLAYER_WSN_CMD_DEVSTATE, PLAYER_WSN_CODE, PLAYER_WSN_DATA, PLAYER_WSN_MAX_NODES, PLAYER_WSN_REQ_DATAFREQ, PLAYER_WSN_REQ_DATATYPE, PLAYER_WSN_REQ_POWER, PLAYER_WSN_STRING, SPEECH_RECOGNITION_DATA_STRING, SPEECH_RECOGNITION_TEXT_LEN |
Method Summary |
PlayerPosition3dData |
getData()
Get the Position3D data. |
PlayerPosition3dGeom |
getGeom()
Get the geometry data. |
float |
getX()
|
float |
getY()
|
float |
getYaw()
|
protected void |
handleResponse(PlayerMsgHdr header)
Handle acknowledgement response messages. |
boolean |
isDataReady()
Check if data is available. |
boolean |
isGeomReady()
Check if geometry data is available. |
void |
queryGeometry()
Request/reply: Query geometry. |
void |
readData(PlayerMsgHdr header)
This interface returns data regarding the odometric pose and velocity
of the robot, as well as motor stall information. |
void |
resetOdometry()
Configuration request: Reset odometry. |
void |
setControlMode(int state)
Configuration request: Change position control. |
void |
setMotorPower(int state)
Request/reply: Motor power. |
void |
setOdometry(PlayerPose3d pose)
Configuration request: Set odometry. |
void |
setPosition(PlayerPose3d pos,
PlayerPose3d vel,
int state)
Command: position (PLAYER_POSITION3D_CMD_SET_POS)
It accepts new positions and/or velocities for the robot's motors
(drivers may support position control, speed control or both). |
void |
setPosition(PlayerPosition3dCmdPos pp3dcp)
Command: position (PLAYER_POSITION3D_CMD_SET_POS)
It accepts new positions and/or velocities for the robot's motors
(drivers may support position control, speed control or both). |
void |
setPositionPIDParams(float kp,
float ki,
float kd)
Configuration request: Set position PID parameters. |
void |
setSpeed(float speed,
float turnrate)
|
void |
setSpeedProfileParams(float speed,
float acc)
Configuration request: Set speed profile parameters. |
void |
setVelocity(PlayerPose3d vel,
int state)
Command: velocity (PLAYER_POSITION3D_CMD_SET_VEL)
It accepts new positions and/or velocities for the robot's motors
(drivers may support position control, speed control or both). |
void |
setVelocity(PlayerPosition3dCmdVel pp3dcv)
Command: velocity (PLAYER_POSITION3D_CMD_SET_VEL)
It accepts new positions and/or velocities for the robot's motors
(drivers may support position control, speed control or both). |
void |
setVelocityControl(int value)
Configuration request: Change velocity control. |
void |
setVelocityPIDParams(float kp,
float ki,
float kd)
Configuration request: Set velocity PID parameters. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Position3DInterface
public Position3DInterface(PlayerClient pc)
- Constructor for Position3DInterface.
- Parameters:
pc
- a reference to the PlayerClient object
readData
public void readData(PlayerMsgHdr header)
- This interface returns data regarding the odometric pose and velocity
of the robot, as well as motor stall information.
- Overrides:
readData
in class PlayerDevice
setPosition
public void setPosition(PlayerPose3d pos,
PlayerPose3d vel,
int state)
- Command: position (PLAYER_POSITION3D_CMD_SET_POS)
It accepts new positions and/or velocities for the robot's motors
(drivers may support position control, speed control or both).
See the player_position3d_cmd_pos structure from player.h
- Parameters:
pos
- a PlayerPose3d structure containing the required position datavel
- a PlayerPose3d structure containing the required velocity datastate
- motor state (zero is either off or locked, depending on the driver)
setPosition
public void setPosition(PlayerPosition3dCmdPos pp3dcp)
- Command: position (PLAYER_POSITION3D_CMD_SET_POS)
It accepts new positions and/or velocities for the robot's motors
(drivers may support position control, speed control or both).
See the player_position3d_cmd_pos structure from player.h
- Parameters:
pp3dcp
- a PlayerPosition3dCmdPos structure holding the required data
setVelocity
public void setVelocity(PlayerPose3d vel,
int state)
- Command: velocity (PLAYER_POSITION3D_CMD_SET_VEL)
It accepts new positions and/or velocities for the robot's motors
(drivers may support position control, speed control or both).
See the player_position3d_cmd_vel structure from player.h
- Parameters:
vel
- a PlayerPose3d structure containing the required velocity datastate
- motor state (zero is either off or locked, depending on the driver)
setVelocity
public void setVelocity(PlayerPosition3dCmdVel pp3dcv)
- Command: velocity (PLAYER_POSITION3D_CMD_SET_VEL)
It accepts new positions and/or velocities for the robot's motors
(drivers may support position control, speed control or both).
See the player_position3d_cmd_vel structure from player.h
- Parameters:
pp3dcv
- a PlayerPosition3dCmdVel structure holding the required data
queryGeometry
public void queryGeometry()
- Request/reply: Query geometry.
To request robot geometry, send a null PLAYER_POSITION3D_GET_GEOM
request.
setMotorPower
public void setMotorPower(int state)
- Request/reply: Motor power.
On some robots, the motor power can be turned on and off from software.
TO do so, send a PLAYER_POSITION3D_MOTOR_POWER request with the format
given below, and with the appropriate state (zero for motors off, and
non-zero for motors on). Null response.
Be VERY careful with this command! You are very likely to start the robot
running across the room at high speed with the battery charger still attached.
- Parameters:
state
- 0 for off, 1 for on
setControlMode
public void setControlMode(int state)
- Configuration request: Change position control.
To change control mode, send a PLAYER_POSITION3D_POSITION_MODE request.
Null response.
- Parameters:
state
- 0 for velocity mode, 1 for position mode
setVelocityControl
public void setVelocityControl(int value)
- Configuration request: Change velocity control.
Some robots offer different velocity control modes. It can be changed
by sending a request with the format given below, including the
appropriate mode. No matter which mode is used, the external client
interface to the position3d device remains the same. Null response.
- Parameters:
value
- driver-specific
setOdometry
public void setOdometry(PlayerPose3d pose)
- Configuration request: Set odometry.
To set the robot's odometry to a particular state, send a
PLAYER_POSITION3D_SET_ODOM request. Null response.
- Parameters:
pose
- a PlayerPose3d structure containing the pose data
resetOdometry
public void resetOdometry()
- Configuration request: Reset odometry.
To reset the robot's odometry to (x,y,theta) = (0,0,0), send a
PLAYER_POSITION3D_RESET_ODOM request. Null response.
setVelocityPIDParams
public void setVelocityPIDParams(float kp,
float ki,
float kd)
- Configuration request: Set velocity PID parameters.
- Parameters:
kp
- P parameterki
- I parameterkd
- D parameter
setPositionPIDParams
public void setPositionPIDParams(float kp,
float ki,
float kd)
- Configuration request: Set position PID parameters.
- Parameters:
kp
- P parameterki
- I parameterkd
- D parameter
setSpeedProfileParams
public void setSpeedProfileParams(float speed,
float acc)
- Configuration request: Set speed profile parameters.
- Parameters:
speed
- max speed [rad/s]acc
- max acceleration [rad/s^2]
handleResponse
protected void handleResponse(PlayerMsgHdr header)
- Handle acknowledgement response messages.
- Overrides:
handleResponse
in class PlayerDevice
- Parameters:
header
- Player header
getData
public PlayerPosition3dData getData()
- Get the Position3D data.
- Returns:
- an object of type PlayerPosition3DData containing the requested data
getGeom
public PlayerPosition3dGeom getGeom()
- Get the geometry data.
- Returns:
- an object of type PlayerPosition3DGeom containing the requested data
isDataReady
public boolean isDataReady()
- Check if data is available.
- Returns:
- true if ready, false if not ready
isGeomReady
public boolean isGeomReady()
- Check if geometry data is available.
- Returns:
- true if ready, false if not ready
getX
public float getX()
- Specified by:
getX
in class AbstractPositionDevice
getY
public float getY()
- Specified by:
getY
in class AbstractPositionDevice
getYaw
public float getYaw()
- Specified by:
getYaw
in class AbstractPositionDevice
setSpeed
public void setSpeed(float speed,
float turnrate)
- Specified by:
setSpeed
in class AbstractPositionDevice