public class RotatingRangeScanner extends java.lang.Object implements RangeScanner
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
RotatingRangeScanner(RegulatedMotor head,
RangeFinder rangeFinder)
The constructor specifies the motor and range finder used
|
RotatingRangeScanner(RegulatedMotor head,
RangeFinder rangeFinder,
int gearRatio) |
Modifier and Type | Method and Description |
---|---|
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
|
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
public RotatingRangeScanner(RegulatedMotor head, RangeFinder rangeFinder)
head
- the motor that rotates the sensorrangeFinder
- the range finderpublic RotatingRangeScanner(RegulatedMotor head, RangeFinder rangeFinder, int gearRatio)
public void setGearRatio(int gearRatio)
gearRatio
- the gear ratiopublic void setHeadMotor(RegulatedMotor motor)
motor
- the head motorpublic RangeReadings getRangeValues()
getRangeValues
in interface RangeScanner
public void setAngles(float[] angles)
setAngles
in interface RangeScanner
angles
- public RangeFinder getRangeFinder()
getRangeFinder
in interface RangeScanner