javaclient
Class BumperInterface

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

public class BumperInterface
extends PlayerDevice

The bumper interface returns data from a bumper array.

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

Field Summary
protected  short PLAYER_BUMPER_GET_GEOM_REQ
           
static int PLAYER_BUMPER_MAX_SAMPLES
          maximum number of bumper samples
 
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
BumperInterface(PlayerClient pc, short indexOfDevice)
          Constructor for BumperInterface.
 
Method Summary
 byte getBumperCount()
          Returns the number of bumpers specified in the Player world file (the number of valid bumper readings).
 byte[] getBumpers()
          Returns the bumpers array data values up to PLAYER_BUMPER_MAX_SAMPLES.
 PlayerBumperGeomT getPlayerBumperGeom()
          Get the geometry data.
 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 bumper values.
 
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_BUMPER_MAX_SAMPLES

public static final int PLAYER_BUMPER_MAX_SAMPLES
maximum number of bumper samples

See Also:
Constant Field Values

PLAYER_BUMPER_GET_GEOM_REQ

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

BumperInterface

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

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

readData

public void readData()
Read the bumper values.

Overrides:
readData in class PlayerDevice

queryGeometry

public void queryGeometry()
Configuration request: Query geometry.

See the player_bumper_geom structure from player.h


getBumpers

public byte[] getBumpers()
Returns the bumpers array data values up to PLAYER_BUMPER_MAX_SAMPLES.

Returns:
an array filled with the bumper values

getBumperCount

public byte getBumperCount()
Returns the number of bumpers specified in the Player world file (the number of valid bumper readings).

Returns:
the number of bumpers specified in the Player world file as a byte

getPlayerBumperGeom

public PlayerBumperGeomT getPlayerBumperGeom()
Get the geometry data.

Returns:
an object of type PlayerBumperGeomT containing the required geometry data

isGeomReady

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

Returns:
true if ready, false if not ready

handleResponse

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

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