javaclient
Class LaserInterface

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

public class LaserInterface
extends PlayerDevice

The laser interface provides access to a single-origin scanning range sensor, such as a SICK laser range-finder (e.g., sicklms200).

Devices supporting the laser interface can be configured to scan at different angles and resolutions. As such, the data returned by the laser interface can take different forms. To make interpretation of the data simple, the laser data packet contains some extra fields before the actual range data. These fields tell the client the starting and ending angles of the scan, the angular resolution of the scan, and the number of range readings included. Scans proceed counterclockwise about the laser (0 degrees is forward). The laser can return a maximum of 401 readings; this limits the valid combinations of scan width and angular resolution.

This interface accepts no commands.

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

Field Summary
protected  short PLAYER_LASER_GET_CONFIG
           
protected  short PLAYER_LASER_GET_GEOM
           
 int PLAYER_LASER_MAX_SAMPLES
          maximum number of laser range values
protected  short PLAYER_LASER_POWER_CONFIG
           
protected  short PLAYER_LASER_SET_CONFIG
           
 
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
LaserInterface(PlayerClient pc, short indexOfDevice)
          Constructor for LaserInterface.
 
Method Summary
 void getGeometry()
          Configuration request: Get geometry.
 int[] getIntensity()
          Return the intensity readings.
 short getMaxAngle()
          Return the end angle for the laser scan in units of 0.01 degrees.
 short getMinAngle()
          Return the start angle for the laser scan in units of 0.01 degrees.
 PlayerLaserConfigT getPlayerLaserConfig()
          Get the laser configuration after a PLAYER_LASER_GET_CONFIG request.
 PlayerLaserGeomT getPlayerLaserGeom()
          Get the laser geometry after a PLAYER_LASER_GET_GEOM request.
 int getRangeRes()
          Return the range resolution.
 int[] getRanges()
          Return the range readings in mm.
 int getResolution()
          Return the angular resolution in units of 0.01 degrees.
 int getSamplesCount()
          Return the number of range/intensity readings.
 void getScanProperties()
          Configuration request: Get scan properties.
 void handleResponse(int size)
          Handle acknowledgement response messages (threaded mode).
 boolean isReadyPLCT()
          Check if the configuration data is available.
 boolean isReadyPLGT()
          Check if the geometry data is available.
 void readData()
          Read the laser data packet.
 void setPower(byte value)
          Configuration request: Turn power on/off.
 void setScanProperties(short minA, short maxA, short res, short range, byte intent)
          Configuration request: Set scan properties.
 
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_LASER_GET_GEOM

protected final short PLAYER_LASER_GET_GEOM
See Also:
Constant Field Values

PLAYER_LASER_SET_CONFIG

protected final short PLAYER_LASER_SET_CONFIG
See Also:
Constant Field Values

PLAYER_LASER_GET_CONFIG

protected final short PLAYER_LASER_GET_CONFIG
See Also:
Constant Field Values

PLAYER_LASER_POWER_CONFIG

protected final short PLAYER_LASER_POWER_CONFIG
See Also:
Constant Field Values

PLAYER_LASER_MAX_SAMPLES

public final int PLAYER_LASER_MAX_SAMPLES
maximum number of laser range values

See Also:
Constant Field Values
Constructor Detail

LaserInterface

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

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

readData

public void readData()
Read the laser data packet.

Overrides:
readData in class PlayerDevice

getMinAngle

public short getMinAngle()
Return the start angle for the laser scan in units of 0.01 degrees.

Returns:
the start angle for the laser scan as a short

getMaxAngle

public short getMaxAngle()
Return the end angle for the laser scan in units of 0.01 degrees.

Returns:
the end angle for the laser scan as a short

getResolution

public int getResolution()
Return the angular resolution in units of 0.01 degrees.

Returns:
the angular resolution as an integer

getRangeRes

public int getRangeRes()
Return the range resolution.

Returns:
the range resolution as an integer

getSamplesCount

public int getSamplesCount()
Return the number of range/intensity readings.

Returns:
the number of range/intensity readings as an integer

getRanges

public int[] getRanges()
Return the range readings in mm.

Returns:
the range readings as an array of integers

getIntensity

public int[] getIntensity()
Return the intensity readings.

Returns:
the intensity readings as an array of integers

getGeometry

public void getGeometry()
Configuration request: Get geometry.

See the player_laser_geom structure from player.h


setScanProperties

public void setScanProperties(short minA,
                              short maxA,
                              short res,
                              short range,
                              byte intent)
Configuration request: Set scan properties.

Parameters:
minA - start angle for the laser scan
maxA - end angle for the laser scan
res - scan resolution
range - range resolution
intent - enable reflection intensity data

getScanProperties

public void getScanProperties()
Configuration request: Get scan properties.


setPower

public void setPower(byte value)
Configuration request: Turn power on/off.

Parameters:
value - 0 to turn laser off, 1 to turn laser on

handleResponse

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

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

getPlayerLaserGeom

public PlayerLaserGeomT getPlayerLaserGeom()
Get the laser geometry after a PLAYER_LASER_GET_GEOM request.

Returns:
an object of PlayerLaserGeomT type containing the laser geometry
See Also:
isReadyPLGT()

getPlayerLaserConfig

public PlayerLaserConfigT getPlayerLaserConfig()
Get the laser configuration after a PLAYER_LASER_GET_CONFIG request.

Returns:
an object of PlayerLaserConfigT type containing the laser configuration
See Also:
isReadyPLCT()

isReadyPLGT

public boolean isReadyPLGT()
Check if the geometry data is available.

Returns:
true if ready, false if not ready
See Also:
getPlayerLaserGeom()

isReadyPLCT

public boolean isReadyPLCT()
Check if the configuration data is available.

Returns:
true if ready, false if not ready
See Also:
getPlayerLaserConfig()