dlife.robot.hemisson
Class HemissonProximitySensor
java.lang.Object
java.util.Observable
dlife.robot.Device
dlife.robot.ArraySensor<Integer>
dlife.robot.hemisson.HemissonIRSensor
dlife.robot.hemisson.HemissonProximitySensor
public class HemissonProximitySensor
- extends HemissonIRSensor
A class for reading the Hemisson's proximity sensors. Each sensor reading is
an integer value in the range [0...255] with larger values indicating closer
obstacles. Note that the value returned depends not only on the distance to
the obstacle but also on the IR reflectivity of its material. Thus there is
no direct conversion from a proximity sensor reading to the distance to the
obstacle. See the Hemisson Manuals for more information.
The proximity sensors are active sensors. They emit a burst of IR light and
then detect how much of it is reflected. This allows the sensor to detect
obstacles but can also be used to distinguish between surfaces with different
IR reflectivity.
The proximity sensors are arranged around the robot as shown in Figure 1
below.

Figure 1: A Hemisson robot with blue-tooth radio module attached and
and the IR/Proximity sensors labeled.
Red circles represent outward facing sensors.
Yellow circles represent downward facing sensors.
Numerals in the circles correspond to the index of the sensor data
in the HemissonIRSensor and HemissonProximitySensor
objects.
See the HemissonIRSensor documentation for
examples of how to access the sensor values.
- Version:
- May 22, 2007
- Author:
- Grant Braught, Dickinson College
| Fields inherited from class dlife.robot.hemisson.HemissonIRSensor |
FRONT, FRONT_GROUP, FRONT_LEFT, FRONT_RIGHT, GROUND_GROUP, GROUND_LEFT, GROUND_RIGHT, LEFT, LEFT_GROUP, NON_GROUND_GROUP, REAR, RIGHT, RIGHT_GROUP |
|
Method Summary |
protected DeviceDisplay[] |
createGUIObjects()
Get the object that is the GUI for this HemissonProximitySensor. |
static void |
main(String[] args)
A little test program for the HemissonProximitySensor. |
void |
readStateFromRobot()
Get the current proximity sensor readings from the Hemisson. |
| 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.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HemissonProximitySensor
public HemissonProximitySensor()
- Construct a new HemissonProximitySensor.
readStateFromRobot
public void readStateFromRobot()
- Get the current proximity sensor readings from the Hemisson. The new
values are copied into the values array defined by the IntegerArraySensor
class.
- Overrides:
readStateFromRobot in class HemissonIRSensor
- Throws:
RobotCommunicationException - if unable to communicate with the
Hemisson.
createGUIObjects
protected DeviceDisplay[] createGUIObjects()
- Get the object that is the GUI for this HemissonProximitySensor.
- Overrides:
createGUIObjects in class HemissonIRSensor
- Returns:
- an array of DeviceDisplay subclass objects that make up the GUI
for this Device.
main
public static void main(String[] args)
- A little test program for the HemissonProximitySensor. This creates a new
Hemisson and a new HemissonProximitySensor. It displays the GUI for the
sensor readings and then updates the sensor readings until the window is
closed.
- Parameters:
args - none