dLife Home Page

dlife.robot.scribbler
Class ScribblerObstacleSensor

java.lang.Object
  extended by java.util.Observable
      extended by dlife.robot.Device
          extended by dlife.robot.ArraySensor<Boolean>
              extended by dlife.robot.scribbler.ScribblerObstacleSensor

public class ScribblerObstacleSensor
extends ArraySensor<Boolean>

Sensor Scribbler's obstacle sensors.

For each sensor, a value of true indicates the presence of an obstacle in front of the sensor and false indicates the absence of an obstacle.

The obstacle sensors are on the front of the scribbler in the default orientation (Scribbler.FLUKE_AT_REAR). If the robot's orientation is changed to Scribbler.FLUKE_AT_FRONT then the obstacle sensors are at the rear of the robot. The left-to-right ordering of the obstacle sensors is presented with respect to the robot's current orientation.

Version:
Mar 10, 2012
Author:
Grant Braught, Dickinson College

Field Summary
static int LEFT
          Constant for the index of the left obstacle sensor.
static int RIGHT
          Constant for the index of the right obstacle sensor.
 
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
ScribblerObstacleSensor()
          Construct a new ScribblerObstacleSensor.
 
Method Summary
protected  DeviceDisplay[] createGUIObjects()
          Get the GUI for the ScribblerObstacleSensor.
 void freeze()
          This method does nothing.
 boolean getLeftSensor()
          Get the current value of the left obstacle sensor.
 boolean getRightSensor()
          Get the current value of the right obstacle sensor.
 void readStateFromRobot()
          Send a message to the Scribbler to read the state of the obstacle sensor and update the values of this sensor.
 
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
getAutoRead, getGUI, getGUIUpdateDelay, getReadDelay, getRobot, getSensorReadCount, getSensorReadRate, setAutoRead, setGUIUpdateDelay, setReadDelay, setRobot, shutDown, startAutoReadTimer, startUp, 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

LEFT

public static final int LEFT
Constant for the index of the left obstacle sensor.

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
Constant for the index of the right obstacle sensor.

See Also:
Constant Field Values
Constructor Detail

ScribblerObstacleSensor

public ScribblerObstacleSensor()
Construct a new ScribblerObstacleSensor.

Method Detail

freeze

public void freeze()
This method does nothing. There is nothing to freeze for the obstacle sensor.

Specified by:
freeze in class Device

readStateFromRobot

public void readStateFromRobot()
Send a message to the Scribbler to read the state of the obstacle sensor and update the values of this sensor.

Specified by:
readStateFromRobot in class Device

getLeftSensor

public boolean getLeftSensor()
Get the current value of the left obstacle sensor.

Returns:
the value of the left obstacle sensor.

getRightSensor

public boolean getRightSensor()
Get the current value of the right obstacle sensor.

Returns:
the value of the right obstacle sensor.

createGUIObjects

protected DeviceDisplay[] createGUIObjects()
Get the GUI for the ScribblerObstacleSensor.

Specified by:
createGUIObjects in class Device
Returns:
the GUI.

dLife Home Page