|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectlejos.robotics.RotatingRangeScanner
public class RotatingRangeScanner
Implementation of RangeScanner with a rotating ultrasonic sensor or other range finder
| Field Summary | |
|---|---|
protected float[] |
angles
|
protected int |
gearRatio
|
protected RegulatedMotor |
head
|
protected int |
MAX_RELIABLE_RANGE_READING
|
protected RangeFinder |
rangeFinder
|
protected RangeReadings |
readings
|
protected int |
ZERO
|
| Constructor Summary | |
|---|---|
RotatingRangeScanner(RegulatedMotor head,
RangeFinder rangeFinder)
The constructor specifies the motor and range finder used |
|
RotatingRangeScanner(RegulatedMotor head,
RangeFinder rangeFinder,
int gearRatio)
|
|
| Method Summary | |
|---|---|
RangeFinder |
getRangeFinder()
returns the rangeFinder - allows other objects to get a range value. |
RangeReadings |
getRangeValues()
Returns a set of Range Readings taken the angles specified. |
void |
setAngles(float[] angles)
set the angles to be used by the getRangeValues() method |
void |
setGearRatio(int gearRatio)
Set the gear ratio |
void |
setHeadMotor(RegulatedMotor motor)
Set the head motor |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final int MAX_RELIABLE_RANGE_READING
protected final int ZERO
protected RangeReadings readings
protected RangeFinder rangeFinder
protected RegulatedMotor head
protected float[] angles
protected int gearRatio
| Constructor Detail |
|---|
public RotatingRangeScanner(RegulatedMotor head,
RangeFinder rangeFinder)
head - the motor that rotates the sensorrangeFinder - the range finder
public RotatingRangeScanner(RegulatedMotor head,
RangeFinder rangeFinder,
int gearRatio)
| Method Detail |
|---|
public void setGearRatio(int gearRatio)
gearRatio - the gear ratiopublic void setHeadMotor(RegulatedMotor motor)
motor - the head motorpublic RangeReadings getRangeValues()
getRangeValues in interface RangeScannerpublic void setAngles(float[] angles)
setAngles in interface RangeScannerangles - public RangeFinder getRangeFinder()
getRangeFinder in interface RangeScanner
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||