dLife Home Page

dlife.robot.aibo
Class AiboChinButton

java.lang.Object
  extended by java.util.Observable
      extended by dlife.robot.Device
          extended by dlife.robot.ArraySensor<Boolean>
              extended by dlife.robot.aibo.AiboChinButton

public class AiboChinButton
extends ArraySensor<Boolean>

A collection containing the button located on the physical Aibo's chin. The chin button's value is either true (pressed) or false (not pressed).

Version:
Oct 3, 2008, Jun 14, 2010
Author:
Alex Diehl, Nate Mitchell, Grant Braught

Field Summary
static int CHIN
          The index of the chin button 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
AiboChinButton()
          Construct a new AiboChinButton sensor.
 
Method Summary
protected  DeviceDisplay[] createGUIObjects()
          Build the GUI for this AiboChinButton sensor.
 void freeze()
          Does nothing.
 boolean isPressed()
          Determine if the Aibo's chin button is pressed.
 void readStateFromRobot()
          Uses the getButton method to retrieve the value from the robot and stores it in the values array for later access
 
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

CHIN

public static final int CHIN
The index of the chin button value in the values array of this ArraySensor.

See Also:
Constant Field Values
Constructor Detail

AiboChinButton

public AiboChinButton()
Construct a new AiboChinButton sensor.

Method Detail

freeze

public void freeze()
Does nothing.

Specified by:
freeze in class Device

readStateFromRobot

public void readStateFromRobot()
Uses the getButton method to retrieve the value from the robot and stores it in the values array for later access

Specified by:
readStateFromRobot in class Device

isPressed

public boolean isPressed()
Determine if the Aibo's chin button is pressed.

Returns:
true if the chin button is pressed, false if not.

createGUIObjects

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

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

dLife Home Page