dLife Home Page

dlife.robot.aibo
Class AiboPawButtons

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

public class AiboPawButtons
extends ArraySensor<Boolean>

A collection containing all paw buttons located on the physical Aibo. There are a total of 4 buttons on the paws and their values will be stored in this structure. The paw button values are either true (pressed) or false (not pressed).

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 LEFT_FRONT
          The index of the Aibo's left front paw button value in the values array of this ArraySensor.
static int LEFT_REAR
          The index of the Aibo's left rear paw button value in the values array of this ArraySensor.
static int RIGHT_FRONT
          The index of the Aibo's right front paw button value in the values array of this ArraySensor.
static int RIGHT_REAR
          The index of the Aibo's right rear paw 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
AiboPawButtons()
          Construct a new AiboPawButtons sensor.
 
Method Summary
protected  DeviceDisplay[] createGUIObjects()
          Build the GUI for this AiboPawButtons Sensor.
 void freeze()
          Does nothing.
 boolean isPressed(int pawNumber)
          Returns whether or not the specified paw button is pressed.
 void readStateFromRobot()
          Retrieves values representing the paw button states from the Aibo robot and stores them in the values array Unpressed buttons are stored as false, and pressed buttons are stored as true.
 
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_FRONT

public static final int LEFT_FRONT
The index of the Aibo's left front paw button value in the values array of this ArraySensor.

See Also:
Constant Field Values

RIGHT_FRONT

public static final int RIGHT_FRONT
The index of the Aibo's right front paw button value in the values array of this ArraySensor.

See Also:
Constant Field Values

LEFT_REAR

public static final int LEFT_REAR
The index of the Aibo's left rear paw button value in the values array of this ArraySensor.

See Also:
Constant Field Values

RIGHT_REAR

public static final int RIGHT_REAR
The index of the Aibo's right rear paw button value in the values array of this ArraySensor.

See Also:
Constant Field Values
Constructor Detail

AiboPawButtons

public AiboPawButtons()
Construct a new AiboPawButtons sensor.

Method Detail

freeze

public void freeze()
Does nothing.

Specified by:
freeze in class Device

readStateFromRobot

public void readStateFromRobot()
Retrieves values representing the paw button states from the Aibo robot and stores them in the values array Unpressed buttons are stored as false, and pressed buttons are stored as true.

Specified by:
readStateFromRobot in class Device

isPressed

public boolean isPressed(int pawNumber)
Returns whether or not the specified paw button is pressed.

Parameters:
pawNumber - one of the class constants indicating which paw data to return
Returns:
true if the specified paw buttton is pressed.

createGUIObjects

protected DeviceDisplay[] createGUIObjects()
Build the GUI for this AiboPawButtons 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