javaclient
Class NomadInterface

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

public class NomadInterface
extends PlayerDevice

The nomad interface affords control of Nomadics Nomad robots and relatives.

Warning: some of the command and data variables are specified in native Nomad units; they don't follow Player's conventions. This will be changed once someone figures out exactly what the Nomad units are.

Version:
Author:
Radu Bogdan Rusu

Field Summary
static short PLAYER_NOMAD_BUMPER_COUNT
           
static short PLAYER_NOMAD_IR_COUNT
           
static short PLAYER_NOMAD_SONAR_COUNT
           
 
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
NomadInterface(PlayerClient pc, short indexOfDevice)
          Constructor for NomadInterface.
 
Method Summary
 int getA()
          Return the heading in degrees.
 int[] getBumpers()
          Return the bump sensors status.
 int[] getIRs()
          Return the infrared range sensors range in mm.
 int[] getSonars()
          Return the sonar range sensors range in mm.
 int getVelSteer()
          Return the steering velocity (in native Nomad units).
 int getVelTrans()
          Return the translation velocity (in native Nomad units).
 int getVelTurret()
          Return the turret rotation velocity (in native Nomad units)
 int getX()
          Return the X position in mm.
 int getY()
          Return the Y position in mm.
 void readData()
          Read the NOMAD data.
The nomad data packet provides a pose estimate, sonar and infrared range readings, and bumper contact readings.
 void setVelocities(int newveltrans, int newvelsteer, int newvelturret)
          The Nomad command packet lets you set independent velocities for translation, steering and turret rotation.
 
Methods inherited from class javaclient.PlayerDevice
getTimeForDataSampled_sec, getTimeForDataSampled_usec, getTimeForDataSampled, getTimeForDataSent_sec, getTimeForDataSent_usec, getTimeForDataSent, handleEARMessage, handleNARMessage, handleResponse, readHeader, sendHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLAYER_NOMAD_SONAR_COUNT

public static final short PLAYER_NOMAD_SONAR_COUNT
See Also:
Constant Field Values

PLAYER_NOMAD_BUMPER_COUNT

public static final short PLAYER_NOMAD_BUMPER_COUNT
See Also:
Constant Field Values

PLAYER_NOMAD_IR_COUNT

public static final short PLAYER_NOMAD_IR_COUNT
See Also:
Constant Field Values
Constructor Detail

NomadInterface

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

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

readData

public void readData()
Read the NOMAD data.
The nomad data packet provides a pose estimate, sonar and infrared range readings, and bumper contact readings.

Overrides:
readData in class PlayerDevice

getX

public int getX()
Return the X position in mm.

Returns:
the X position in mm as an integer

getY

public int getY()
Return the Y position in mm.

Returns:
the Y position in mm as an integer

getA

public int getA()
Return the heading in degrees.

Returns:
the heading in degrees as an integer

getVelTrans

public int getVelTrans()
Return the translation velocity (in native Nomad units).

Returns:
the translation velocity (in native Nomad units) as an integer

getVelSteer

public int getVelSteer()
Return the steering velocity (in native Nomad units).

Returns:
the steering velocity (in native Nomad units) as an integer

getVelTurret

public int getVelTurret()
Return the turret rotation velocity (in native Nomad units)

Returns:
the turret rotation velocity (in native Nomad units) as an integer

getSonars

public int[] getSonars()
Return the sonar range sensors range in mm.

Returns:
the sonar range sensors range in mm as an array of integers

getIRs

public int[] getIRs()
Return the infrared range sensors range in mm.

Returns:
the infrared range sensors range in mm as an array of integers

getBumpers

public int[] getBumpers()
Return the bump sensors status.

Returns:
the bump sensors status (zero - no contact, non-zero - contact) as an array of integers

setVelocities

public void setVelocities(int newveltrans,
                          int newvelsteer,
                          int newvelturret)
The Nomad command packet lets you set independent velocities for translation, steering and turret rotation. These are specified in native Nomad units.

Todo:
This should change in future to match normal Player style (mm/sec), once someone figures out exactly what the Nomad units are.

Parameters:
newveltrans - translation velocity (in native Nomad units)
newvelsteer - steering velocity (in native Nomad units)
newvelturret - turret rotation velocity (in native Nomad units)