|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lejos.nxt.addon.GyroDirectionFinder
public class GyroDirectionFinder
Implementation of the DirectionFinder
interface that integrates repeated rate-of-turn readings from a
into a continuously updated heading. This class is very similar to GyroSensor
,
except that the direction returned does not convey true heading (north, south, etc) but rather
relative heading change since the last time CompassMindSensor
setDegrees()
or resetCartesianZero()
was called.
GyroSensor
Constructor Summary | |
---|---|
GyroDirectionFinder(Gyroscope gyro)
Creates and initializes a new GyroDirectionFinder using passed GyroSensor |
|
GyroDirectionFinder(Gyroscope gyro,
boolean calibrate)
Creates and initializes a new GyroDirectionFinder using passed GyroSensor and does
the GyroSensor.recalibrateOffset() method. |
Method Summary | |
---|---|
float |
getAngularAcceleration()
Returns the current rate at which the angular velocity is increasing or decreasing in degrees-per-second, per second. |
float |
getAngularVelocity()
Returns the current rate-of-turn in degrees/second, as read by the GyroSensor instance passed in the constructor. |
float |
getDegrees()
Returns the directional heading in degrees. |
float |
getDegreesCartesian()
Returns the current rate-of-turn in degrees, as read by the GyroSensor . |
void |
resetCartesianZero()
Resets the current heading to zero. |
void |
setDegrees(float heading)
Resets the current heading to a desired value. |
void |
setDegreesCartesian(float heading)
Resets the current heading to a desired value. |
void |
startCalibration()
Find offset/bias of gyro while at rest (ensure it is at rest). |
void |
stopCalibration()
NO FUNCTIONALITY EQUIVALENT for GyroSensor so implemented just to satisfy the DirectionFinder interface. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GyroDirectionFinder(Gyroscope gyro)
GyroDirectionFinder
using passed GyroSensor
gyro
- A GyroSensor
instanceGyroSensor
public GyroDirectionFinder(Gyroscope gyro, boolean calibrate)
GyroDirectionFinder
using passed GyroSensor
and does
the GyroSensor.recalibrateOffset()
method.
gyro
- A GyroSensor
instanceGyroSensor.recalibrateOffset()
,
startCalibration()
Method Detail |
---|
public void setDegrees(float heading)
getDegrees()
public float getDegrees()
resetCartesianZero()
.
setDegrees(float)
public float getAngularVelocity()
GyroSensor
instance passed in the constructor.
GyroSensor
public float getAngularAcceleration()
public float getDegreesCartesian()
GyroSensor
.
getDegreesCartesian
in interface DirectionFinder
public void setDegreesCartesian(float heading)
public void resetCartesianZero()
resetCartesianZero
in interface DirectionFinder
public void startCalibration()
recalibrateOffset()
method of
the GyroSensor
instance passed in the constructor. This takes 3 seconds.
startCalibration
in interface DirectionFinder
GyroSensor.recalibrateOffset()
public void stopCalibration()
GyroSensor
so implemented just to satisfy the DirectionFinder
interface.
Does nothing.
stopCalibration
in interface DirectionFinder
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |