javaclient
Class TruthInterface

java.lang.Object
  extended by javaclient.PlayerDevice
      extended by javaclient.TruthInterface

public class TruthInterface
extends PlayerDevice

The truth interface provides access to the absolute state of entities. Note that, unless your robot has superpowers, truth devices are only avilable in simulation.

Version:
Author:
Maxim A. Batalin & Radu Bogdan Rusu

Field Summary
protected  short PLAYER_TRUTH_GET_FIDUCIAL_ID
           
protected  short PLAYER_TRUTH_GET_POSE
           
protected  short PLAYER_TRUTH_SET_FIDUCIAL_ID
           
protected  short PLAYER_TRUTH_SET_POSE
           
protected  short PLAYER_TRUTH_SET_POSE_ON_ROOT
           
 
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
TruthInterface(PlayerClient pc, short indexOfDevice)
          Constructor for TruthInterface.
 
Method Summary
 int getPhead()
          Get P orientation in millirad.
 int getRhead()
          Get R orientation in millirad.
 int getXpos()
          Get X position in mm.
 int getYhead()
          Get Y orientation in millirad.
 int getYpos()
          Get Y position in mm.
 int getZpos()
          Get Z position in mm.
 void handleResponse(int size)
          Handle acknowledgement response messages (threaded mode).
 boolean isTeleported()
          Check if the teleportation (PLAYER_TRUTH_SET_POSE) was successful or not.
 void readData()
          Read the current state of the entity.
 void teleport(int x, int y)
          Set the pose of the current entity.
 void teleport(int x, int y, int z)
          Set the pose of the current entity.
 void teleport(int xp, int yp, int zp, int ro, int po, int yo)
          Set the pose of the current entity.
 
Methods inherited from class javaclient.PlayerDevice
getTimeForDataSampled_sec, getTimeForDataSampled_usec, getTimeForDataSampled, getTimeForDataSent_sec, getTimeForDataSent_usec, getTimeForDataSent, handleEARMessage, handleNARMessage, readHeader, sendHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLAYER_TRUTH_GET_POSE

protected final short PLAYER_TRUTH_GET_POSE
See Also:
Constant Field Values

PLAYER_TRUTH_SET_POSE

protected final short PLAYER_TRUTH_SET_POSE
See Also:
Constant Field Values

PLAYER_TRUTH_SET_POSE_ON_ROOT

protected final short PLAYER_TRUTH_SET_POSE_ON_ROOT
See Also:
Constant Field Values

PLAYER_TRUTH_GET_FIDUCIAL_ID

protected final short PLAYER_TRUTH_GET_FIDUCIAL_ID
See Also:
Constant Field Values

PLAYER_TRUTH_SET_FIDUCIAL_ID

protected final short PLAYER_TRUTH_SET_FIDUCIAL_ID
See Also:
Constant Field Values
Constructor Detail

TruthInterface

public TruthInterface(PlayerClient pc,
                      short indexOfDevice)
Constructor for TruthInterface.

Parameters:
pc - a reference to the PlayerClient object
indexOfDevice - the index of the device
Method Detail

readData

public void readData()
Read the current state of the entity.

Overrides:
readData in class PlayerDevice

getXpos

public int getXpos()
Get X position in mm.

Returns:
X position in mm

getYpos

public int getYpos()
Get Y position in mm.

Returns:
Y position in mm

getZpos

public int getZpos()
Get Z position in mm.

Returns:
Z position in mm

getRhead

public int getRhead()
Get R orientation in millirad.

Returns:
R orientation in millirad

getPhead

public int getPhead()
Get P orientation in millirad.

Returns:
P orientation in millirad

getYhead

public int getYhead()
Get Y orientation in millirad.

Returns:
Y orientation in millirad

teleport

public void teleport(int x,
                     int y)
Set the pose of the current entity.

Parameters:
x - X position in mm
y - Y position in mm

teleport

public void teleport(int x,
                     int y,
                     int z)
Set the pose of the current entity.

Parameters:
x - X position in mm
y - Y position in mm
z - Z position in mm

teleport

public void teleport(int xp,
                     int yp,
                     int zp,
                     int ro,
                     int po,
                     int yo)
Set the pose of the current entity.

Parameters:
xp - X position in mm
yp - Y position in mm
zp - Z position in mm
ro - R orientation in millirad
po - P orientation in millirad
yo - Y orientation in millirad

isTeleported

public boolean isTeleported()
Check if the teleportation (PLAYER_TRUTH_SET_POSE) was successful or not.

Returns:
true if successful, false if not

handleResponse

public void handleResponse(int size)
Handle acknowledgement response messages (threaded mode).

Overrides:
handleResponse in class PlayerDevice
Parameters:
size - size of the payload