dLife Home Page

dlife.robot
Class DeadReckoningSensor

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

public abstract class DeadReckoningSensor
extends ArraySensor<Double>

Abstract base class for Sensors that access the dead reckoning data from a robot. This base class provides methods for accessing the the X,Y and Theta positions of the robot.

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

Field Summary
static int THETA_COORDINATE
          The Theta Coordinate (in degrees) of the Dead Reckoning data.
static int X_COORDINATE
          The X Coordinate of the Dead Reckoning data.
static int Y_COORDINATE
          The X Coordinate of the Dead Reckoning 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
DeadReckoningSensor()
          Create a new DeadReckoningSensor.
 
Method Summary
protected  DeviceDisplay[] createGUIObjects()
          Build the GUI for this DeadReckoning sensor and return a reference to it.
 double getThetaDegrees()
          Get the Theta coordinate (in degrees) from the robot's dead reckoning device.
 double getThetaRadians()
          Get the Theta coordinate (in radians) from the robot's dead reckoning device.
 int getX()
          Get the X coordinate (in millimeters) from the robot's dead reckoning device.
 int getY()
          Get the Y coordinate (in millimeters) from the robot's dead reckoning device.
abstract  void reset()
          Reset the robot's dead reckoning device to the position (0,0,0).
 void startUp()
          When the DeadReckoningSensor is started it resets the sensor to the position (0,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

X_COORDINATE

public static final int X_COORDINATE
The X Coordinate of the Dead Reckoning data.

See Also:
Constant Field Values

Y_COORDINATE

public static final int Y_COORDINATE
The X Coordinate of the Dead Reckoning data.

See Also:
Constant Field Values

THETA_COORDINATE

public static final int THETA_COORDINATE
The Theta Coordinate (in degrees) of the Dead Reckoning data.

See Also:
Constant Field Values
Constructor Detail

DeadReckoningSensor

public DeadReckoningSensor()
Create a new DeadReckoningSensor.

Method Detail

createGUIObjects

protected DeviceDisplay[] createGUIObjects()
Build the GUI for this DeadReckoning sensor and return a reference to it.

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

startUp

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

Overrides:
startUp in class Device

getX

public int getX()
Get the X coordinate (in millimeters) from the robot's dead reckoning device.

Returns:
the X coordinate.

getY

public int getY()
Get the Y coordinate (in millimeters) from the robot's dead reckoning device.

Returns:
the Y coordinate.

getThetaDegrees

public double getThetaDegrees()
Get the Theta coordinate (in degrees) from the robot's dead reckoning device.

Returns:
the Theta coordinate in degrees.

getThetaRadians

public double getThetaRadians()
Get the Theta coordinate (in radians) from the robot's dead reckoning device.

Returns:
the Theta coordinate in radians.

reset

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


dLife Home Page