dLife Home Page

dlife.robot.aibo
Class AiboBatterySensor

java.lang.Object
  extended by java.util.Observable
      extended by dlife.robot.Device
          extended by dlife.robot.ArraySensor<Float>
              extended by dlife.robot.aibo.AiboBatterySensor

public class AiboBatterySensor
extends ArraySensor<Float>

Structure to store the power sensors on the Aibo. The Aibo's power sensors report the following values:

Version:
Feb 5 2008, Oct 3, 2008, Jun 17, 2010
Author:
Mike Olasin, Luke Maffey, Alex Diehl, Nate Mitchell, Grant Braught

Field Summary
static int CHARGE
          The index of the battery charge percentage in the values array of this ArraySensor.
static int CURRENT
          The index of the electrical current value in the values array of this ArraySensor.
static int POWER
          The index of the power value in the values array of this ArraySensor.
static int TEMPERATURE
          The index of the temperature value in the values array of this ArraySensor.
static int VOLTAGE
          The index of the voltage value in the values array of this ArraySensor.
 
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
AiboBatterySensor()
          Construct a new AiboBatterySensor object.
 
Method Summary
protected  DeviceDisplay[] createGUIObjects()
          Build the GUI for this AiboBatterySensor.
 void freeze()
          Does nothing.
 float getBatteryCharge()
          Get the percentage charge of the battery.
 float getBatteryCurrent()
          Get the electrical current output of the battery in milliamps.
 float getBatteryPower()
          Get the power output of the battery in mA Hours.
 float getBatteryTemperature()
          Get the temperature of the battery in degrees Celsius.
 float getBatteryVoltage()
          Get the battery voltage in Volts.
 void readStateFromRobot()
          Reads the power values from the Aibo robot and stores them as strings in the value array for later access, along with units
 
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

CHARGE

public static final int CHARGE
The index of the battery charge percentage in the values array of this ArraySensor.

See Also:
Constant Field Values

TEMPERATURE

public static final int TEMPERATURE
The index of the temperature value in the values array of this ArraySensor.

See Also:
Constant Field Values

POWER

public static final int POWER
The index of the power value in the values array of this ArraySensor.

See Also:
Constant Field Values

VOLTAGE

public static final int VOLTAGE
The index of the voltage value in the values array of this ArraySensor.

See Also:
Constant Field Values

CURRENT

public static final int CURRENT
The index of the electrical current value in the values array of this ArraySensor.

See Also:
Constant Field Values
Constructor Detail

AiboBatterySensor

public AiboBatterySensor()
Construct a new AiboBatterySensor object.

Method Detail

freeze

public void freeze()
Does nothing.

Specified by:
freeze in class Device

readStateFromRobot

public void readStateFromRobot()
Reads the power values from the Aibo robot and stores them as strings in the value array for later access, along with units

Specified by:
readStateFromRobot in class Device

getBatteryCharge

public float getBatteryCharge()
Get the percentage charge of the battery. 100% indicates a full charge.

Returns:
the percentage charge of the battery.

getBatteryTemperature

public float getBatteryTemperature()
Get the temperature of the battery in degrees Celsius.

Returns:
the temperature of the battery.

getBatteryPower

public float getBatteryPower()
Get the power output of the battery in mA Hours.

Returns:
the power output of the battery.

getBatteryVoltage

public float getBatteryVoltage()
Get the battery voltage in Volts.

Returns:
the voltage of the battery.

getBatteryCurrent

public float getBatteryCurrent()
Get the electrical current output of the battery in milliamps.

Returns:
the electrical current output of the battery.

createGUIObjects

protected DeviceDisplay[] createGUIObjects()
Build the GUI for this AiboBatterySensor.

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

dLife Home Page