dLife Home Page

dlife.robot
Class OdometrySensor

java.lang.Object
  extended by java.util.Observable
      extended by dlife.robot.Device
          extended by dlife.robot.ArraySensor<Double>
              extended by dlife.robot.OdometrySensor
Direct Known Subclasses:
PioneerOdometry

public abstract class OdometrySensor
extends ArraySensor<Double>

Abstract base class for Sensors that access a robot's Odometry data from.

Version:
Jun 25, 2008
Author:
Grant Braught, Dickinson College

Field Summary
static int ANGLE_COORDINATE
          The Angle Coordinate of the odometry data.
static int DISTANCE_COORDINATE
          The Distance Coordinate of the odometry data.
 
Fields inherited from class dlife.robot.ArraySensor
length, values
 
Fields inherited from class dlife.robot.Device
DEFAULT_GUI_UPDATE_DELAY, DEFAULT_READ_DELAY, myRobot, readCount
 
Constructor Summary
OdometrySensor()
          Create a new OdometrySensor.
 
Method Summary
protected  DeviceDisplay[] createGUIObjects()
          Construct the GUI object for this OdometrySensor.
 double getAngleDegrees()
          Get the Angle coordinate (in degrees) from the robot's odometry device.
 double getAngleRadians()
          Get the Angle coordinate (in radians) from the robot's odometry device.
 int getDistance()
          Get the Distance coordinate (in millimeters) from the robot's odometry device.
abstract  void reset()
          Reset the robot's odometry device to (0,0).
 void startUp()
          When the OdometrySensor is started it resets the sensor to (0,0).
 
Methods inherited from class dlife.robot.ArraySensor
getAverage, getAverage, getMaximum, getMaximum, getMaximumIndex, getMaximumIndex, getMinimum, getMinimum, getMinimumIndex, getMinimumIndex, getNumValues, getSubset, getValue, getValues
 
Methods inherited from class dlife.robot.Device
freeze, getAutoRead, getGUI, getGUIUpdateDelay, getReadDelay, getRobot, getSensorReadCount, getSensorReadRate, readStateFromRobot, setAutoRead, setGUIUpdateDelay, setReadDelay, setRobot, shutDown, startAutoReadTimer, stopAutoReadTimer
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DISTANCE_COORDINATE

public static final int DISTANCE_COORDINATE
The Distance Coordinate of the odometry data.

See Also:
Constant Field Values

ANGLE_COORDINATE

public static final int ANGLE_COORDINATE
The Angle Coordinate of the odometry data.

See Also:
Constant Field Values
Constructor Detail

OdometrySensor

public OdometrySensor()
Create a new OdometrySensor.

Method Detail

startUp

public void startUp()
When the OdometrySensor is started it resets the sensor to (0,0).

Overrides:
startUp in class Device

getDistance

public int getDistance()
Get the Distance coordinate (in millimeters) from the robot's odometry device.

Returns:
the distance.

getAngleDegrees

public double getAngleDegrees()
Get the Angle coordinate (in degrees) from the robot's odometry device.

Returns:
the angle in degrees.

getAngleRadians

public double getAngleRadians()
Get the Angle coordinate (in radians) from the robot's odometry device.

Returns:
the Angle in radians.

createGUIObjects

protected DeviceDisplay[] createGUIObjects()
Construct the GUI object for this OdometrySensor.

Specified by:
createGUIObjects in class Device
Returns:
an array of DeviceDisplay subclass objects that make up the GUI for this Device.

reset

public abstract void reset()
Reset the robot's odometry device to (0,0).


dLife Home Page