|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Observable
dlife.robot.Device
dlife.robot.ArraySensor<Integer>
dlife.robot.scribbler.FlukeIRSensor
public class FlukeIRSensor
Sensor for the IR obstacle sensors on the Fluke. This sensor is useful for detecting obstacles to the front-left, front-center or front-right of the Fluke. The Fluke emits IR pulses and measures the number of pulses that return to each sensor. The larger the value the more pulses returned, indicating the presence of an obstacle from which the pulses were reflected.
This class assumes that the Fluke camera always faces the front of the robot. Thus, in FLUKE_AT_REAR mode the reversing dongle is used. When this is done the left-right positions of the IR sensors remains the same with respect to the orientation of the robot. If your Fluke is not mounted in the above manner then you will need to compensate for the reversed position of the Fluke when accessing the IR sensors.
This sensor seems particularly sensitive to the IR Power setting. The default setting is 135 which worked well on the Fluke with which it was tested. You may need to tune this value to something that works well with your Fluke. If your readings are very low, try increasing the power. If the readings are very high try reducing the power.
| Field Summary | |
|---|---|
static int |
CENTER
Constant for the index of the center IR sensor. |
static int |
LEFT
Constant for the index of the left IR sensor. |
static int |
RIGHT
Constant for the index of the right IR sensor. |
| 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 | |
|---|---|
FlukeIRSensor()
Construct a new FlukeIRSensor. |
|
| Method Summary | |
|---|---|
protected DeviceDisplay[] |
createGUIObjects()
Get the GUI for the FlukeIRSensor. |
void |
freeze()
This method does nothing. |
int |
getCenterSensor()
Get the current value of the center IR sensor. |
byte |
getIRPower()
Get the current power setting for the IR sensor. |
int |
getLeftSensor()
Get the current value of the left IR sensor. |
int |
getRightSensor()
Get the current value of the right IR sensor. |
void |
readStateFromRobot()
Send a message to the Fluke to read the state of each of its 3 IR sensors and update the values of this sensor. |
void |
setIRPower(byte power)
Set the power of the IR transmitters used by the IR 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 |
| Field Detail |
|---|
public static final int LEFT
public static final int CENTER
public static final int RIGHT
| Constructor Detail |
|---|
public FlukeIRSensor()
| Method Detail |
|---|
public void freeze()
freeze in class Devicepublic void startUp()
DeviceThe 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.
startUp in class Devicepublic void readStateFromRobot()
readStateFromRobot in class Devicepublic int getLeftSensor()
public int getCenterSensor()
public int getRightSensor()
public void setIRPower(byte power)
power - the power [0...255].public byte getIRPower()
protected DeviceDisplay[] createGUIObjects()
createGUIObjects in class Device
|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||