javaclient
Class FiducialInterface

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

public class FiducialInterface
extends PlayerDevice

The fiducial interface provides access to devices that detect coded fiducials (markers) placed in the environment. It can also be used for devices the detect natural landmarks.

Version:
Author:
Maxim A. Batalin, Radu Bogdan Rusu & Moshe Sayag

Field Summary
protected  short PLAYER_FIDUCIAL_EXCHANGE_MSG
           
protected  short PLAYER_FIDUCIAL_GET_FOV
           
protected  short PLAYER_FIDUCIAL_GET_GEOM
           
protected  short PLAYER_FIDUCIAL_GET_ID
           
static short PLAYER_FIDUCIAL_MAX_MSG_LEN
          The maximum size of a data packet exchanged with a fiducial at one time
static short PLAYER_FIDUCIAL_MAX_SAMPLES
          The maximum number of fiducials that can be detected at one time
protected  short PLAYER_FIDUCIAL_RECV_MSG
           
protected  short PLAYER_FIDUCIAL_SEND_MSG
           
protected  short PLAYER_FIDUCIAL_SET_FOV
           
protected  short PLAYER_FIDUCIAL_SET_ID
           
 
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
FiducialInterface(PlayerClient pc, short indexOfDevice)
          Constructor for FiducialInterface.
 
Method Summary
 int[] getDetectPose()
          Get the pose of the detector in the robot cs (x, y, orient) in units if (mm, mm, degrees).
 int[] getDetectSize()
          Get the size of the detector in units of (mm, mm).
 int getFiducialCount()
          Get the number of fiducials.
 PlayerFiducialItem[] getFiducials()
          Get the fiducials.
 int[] getFiducialSize()
          Get the dimensions of the fiducials in units of (mm, mm).
 void getFiducialVal()
          Configuration request: Get fiducial value.
 void getFOV()
          Configuration request: Get sensor field of view.
 void getGeometry()
          Configuration request: Get geometry.
 int getID()
          Get the fiducial data value displayed.
 int getMaxRange()
          Get the maximum range of the sensor in mm.
 int getMinRange()
          Get the minimum range of the sensor in mm.
 int getViewAngle()
          Get the receptive angle of the sensor in degrees.
 void handleResponse(int size)
          Handle acknowledgement response messages (threaded mode).
 boolean isFOVReady()
          Check if FOV data is available.
 boolean isGeomReady()
          Check if geometry data is available.
 boolean isIDReady()
          Check if fiducial value data is available.
 void readData()
          Read the fiducial data packet (all fiducials).
 void setFiducialVal(int newID)
          Configuration request: Get fiducial value.
 void setFOV(int newMinRange, int newMaxRange, int newViewAngle)
          Configuration request: Set sensor field of view.
 
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_FIDUCIAL_MAX_SAMPLES

public static final short PLAYER_FIDUCIAL_MAX_SAMPLES
The maximum number of fiducials that can be detected at one time

See Also:
Constant Field Values

PLAYER_FIDUCIAL_MAX_MSG_LEN

public static final short PLAYER_FIDUCIAL_MAX_MSG_LEN
The maximum size of a data packet exchanged with a fiducial at one time

See Also:
Constant Field Values

PLAYER_FIDUCIAL_GET_GEOM

protected final short PLAYER_FIDUCIAL_GET_GEOM
See Also:
Constant Field Values

PLAYER_FIDUCIAL_GET_FOV

protected final short PLAYER_FIDUCIAL_GET_FOV
See Also:
Constant Field Values

PLAYER_FIDUCIAL_SET_FOV

protected final short PLAYER_FIDUCIAL_SET_FOV
See Also:
Constant Field Values

PLAYER_FIDUCIAL_SEND_MSG

protected final short PLAYER_FIDUCIAL_SEND_MSG
See Also:
Constant Field Values

PLAYER_FIDUCIAL_RECV_MSG

protected final short PLAYER_FIDUCIAL_RECV_MSG
See Also:
Constant Field Values

PLAYER_FIDUCIAL_EXCHANGE_MSG

protected final short PLAYER_FIDUCIAL_EXCHANGE_MSG
See Also:
Constant Field Values

PLAYER_FIDUCIAL_GET_ID

protected final short PLAYER_FIDUCIAL_GET_ID
See Also:
Constant Field Values

PLAYER_FIDUCIAL_SET_ID

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

FiducialInterface

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

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

readData

public void readData()
Read the fiducial data packet (all fiducials).

Overrides:
readData in class PlayerDevice

getGeometry

public void getGeometry()
Configuration request: Get geometry.

See the player_fiducial_geom structure from player.h


handleResponse

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

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

isGeomReady

public boolean isGeomReady()
Check if geometry data is available.

Returns:
true if ready, false if not ready

getDetectPose

public int[] getDetectPose()
Get the pose of the detector in the robot cs (x, y, orient) in units if (mm, mm, degrees).

Returns:
an array of integers filled with the pose of the detector

getDetectSize

public int[] getDetectSize()
Get the size of the detector in units of (mm, mm).

Returns:
the size of the detector in units of (mm, mm) as an integer array.

getFiducialSize

public int[] getFiducialSize()
Get the dimensions of the fiducials in units of (mm, mm).

Returns:
the dimensions of the fiducials in units of (mm, mm) as an integer array.

getFOV

public void getFOV()
Configuration request: Get sensor field of view.

The field of view of the fiducial device can be set using the PLAYER_FIDUCIAL_SET_FOV request, and queried using the PLAYER_FIDUCIAL_GET_FOV request. The device replies to a SET request with the actual FOV achieved. In both cases the request and reply packets have the same format.

See the player_fiducial_fov structure from player.h


isFOVReady

public boolean isFOVReady()
Check if FOV data is available.

Returns:
true if ready, false if not ready

getMinRange

public int getMinRange()
Get the minimum range of the sensor in mm.

Returns:
the minimum range of the sensor in mm as an integer

getMaxRange

public int getMaxRange()
Get the maximum range of the sensor in mm.

Returns:
the maximum range of the sensor in mm as an integer

getViewAngle

public int getViewAngle()
Get the receptive angle of the sensor in degrees.

Returns:
the receptive angle of the sensor in degrees as an integer

setFOV

public void setFOV(int newMinRange,
                   int newMaxRange,
                   int newViewAngle)
Configuration request: Set sensor field of view.

The field of view of the fiducial device can be set using the PLAYER_FIDUCIAL_SET_FOV request, and queried using the PLAYER_FIDUCIAL_GET_FOV request. The device replies to a SET request with the actual FOV achieved. In both cases the request and reply packets have the same format.

See the player_fiducial_fov structure from player.h


getFiducialVal

public void getFiducialVal()
Configuration request: Get fiducial value.

Some fiducial finder devices display their own fiducial. They can use the PLAYER_FIDUCIAL_GET_ID config to report the identifier displayed by the fiducial. Make the request using the player_fiducial_id_t structure. The device replies with the same structure with the id field set.

Some devices can dynamically change the identifier they display. They can use the PLAYER_FIDUCIAL_SET_ID config to allow a client to set the currently displayed value. Make the request with the player_fiducial_id_t structure. The device replies with the same structure with the id field set to the value it actually used. You should check this value, as the device may not be able to display the value you requested.

Currently supported by the stg_fiducial driver.

See the player_fiducial_id structure from player.h


isIDReady

public boolean isIDReady()
Check if fiducial value data is available.

Returns:
true if ready, false if not ready

getID

public int getID()
Get the fiducial data value displayed.

Returns:
the fiducial data value as an integer

setFiducialVal

public void setFiducialVal(int newID)
Configuration request: Get fiducial value.

Some fiducial finder devices display their own fiducial. They can use the PLAYER_FIDUCIAL_GET_ID config to report the identifier displayed by the fiducial. Make the request using the player_fiducial_id_t structure. The device replies with the same structure with the id field set.

Some devices can dynamically change the identifier they display. They can use the PLAYER_FIDUCIAL_SET_ID config to allow a client to set the currently displayed value. Make the request with the player_fiducial_id_t structure. The device replies with the same structure with the id field set to the value it actually used. You should check this value, as the device may not be able to display the value you requested.

Currently supported by the stg_fiducial driver.

See the player_fiducial_id structure from player.h


getFiducialCount

public int getFiducialCount()
Get the number of fiducials.

Returns:
the number of fiducials as an integer.

getFiducials

public PlayerFiducialItem[] getFiducials()
Get the fiducials.

Returns:
an array of PlayerFiducialItem.