dLife Home Page

dlife.robot.scribbler
Class ScribblerBattery

java.lang.Object
  extended by java.util.Observable
      extended by dlife.robot.Device
          extended by dlife.robot.ArraySensor<Double>
              extended by dlife.robot.scribbler.ScribblerBattery

public class ScribblerBattery
extends ArraySensor<Double>

Sensor for the Scribbler's battery voltage. Below a voltage of 6.1V the Fluke's back LED will flash.

Version:
Apr 4, 2011
Author:
Grant Braught, Dickinson College

Field Summary
 
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
ScribblerBattery()
          Construct a new ScribblerLineSensor.
 
Method Summary
protected  DeviceDisplay[] createGUIObjects()
          Get the GUI for the ScribblerBattery.
 void freeze()
          This method does nothing.
 double getBatteryVoltage()
          Get the current voltage of the Scribbler's battery.
 void readStateFromRobot()
          Send a message to the Scribbler to read the battery voltage and update the values of this sensor.
 void startUp()
          Perform any startup operations for the device.
 
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, 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
 

Constructor Detail

ScribblerBattery

public ScribblerBattery()
Construct a new ScribblerLineSensor.

Method Detail

startUp

public void startUp()
Perform any startup operations for the device. For example, storing a gripper, centering a PTZ or zeroing a dead reckoning device. The implementation provided by this class sets up some timing information necessary for computing sensor read rate statistics and starts the auto read timer if getAutoRead returns true. Subclasses that have their own start up requirements should override this method but should invoke super.startUp() to ensure that the statistics are computed correctly.

The Robot base class invokes this method once in addSensor or addEffector just before the Device is added to the Robot. The Robot will be alive when this method is invoked so it may send commands to the robot. If there are critical problems completing the startUp then this method should throw a RobotCommunicationException.

Overrides:
startUp in class Device

freeze

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

Specified by:
freeze in class Device

readStateFromRobot

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

Specified by:
readStateFromRobot in class Device

getBatteryVoltage

public double getBatteryVoltage()
Get the current voltage of the Scribbler's battery.

Returns:
the battery voltage.

createGUIObjects

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

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

dLife Home Page