Package lejos.robotics
Class DirectionFinderAdapter
- java.lang.Object
-
- lejos.robotics.DirectionFinderAdapter
-
- All Implemented Interfaces:
Calibrate,DirectionFinder
public class DirectionFinderAdapter extends java.lang.Object implements DirectionFinder
-
-
Constructor Summary
Constructors Constructor Description DirectionFinderAdapter(SampleProvider provider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description floatgetDegreesCartesian()Compass readings increase clockwise from 0 to 360, but Cartesian coordinate systems increase counter-clockwise.voidresetCartesianZero()Changes the current direction the compass is facing into the zero angle.voidstartCalibration()Starts calibration.voidstopCalibration()Ends calibration sequence.
-
-
-
Constructor Detail
-
DirectionFinderAdapter
public DirectionFinderAdapter(SampleProvider provider)
-
-
Method Detail
-
getDegreesCartesian
public float getDegreesCartesian()
Description copied from interface:DirectionFinderCompass readings increase clockwise from 0 to 360, but Cartesian coordinate systems increase counter-clockwise. This method returns the Cartesian compass reading. Also, the resetCartesianZero() method can be used to designate any direction as zero, rather than relying on North as being zero.- Specified by:
getDegreesCartesianin interfaceDirectionFinder- Returns:
- Cartesian direction. Between 0 and 360, excluding 360. Values increase counter-clockwise.
-
startCalibration
public void startCalibration()
Description copied from interface:CalibrateStarts calibration. Must call stopCalibration() when done.- Specified by:
startCalibrationin interfaceCalibrate
-
stopCalibration
public void stopCalibration()
Description copied from interface:CalibrateEnds calibration sequence.- Specified by:
stopCalibrationin interfaceCalibrate
-
resetCartesianZero
public void resetCartesianZero()
Description copied from interface:DirectionFinderChanges the current direction the compass is facing into the zero angle.- Specified by:
resetCartesianZeroin interfaceDirectionFinder
-
-