orbotix.robot.base
Class TiltDriveAlgorithm
java.lang.Object
orbotix.robot.base.DriveAlgorithm
orbotix.robot.base.TiltDriveAlgorithm
public class TiltDriveAlgorithm
- extends DriveAlgorithm
Converts accelerometer coordinates into heading and speed values.
Angles are calculated from the accelerometer coordinates to get the angle the device
is tilted from the device laying flat. The angle from the positive x-axis is used for the
heading and the tilt angle is up to the MAXIMUM_TILT angle is used for speed.
The stopPositon values are consider as radians from the device laying flat. The deadZoneDelta values
are the delta values in the accelerometer values that are still consider zero.
- See Also:
DriveAlgorithm
Method Summary |
void |
convert(double x,
double y,
double z)
Converts the input coordinates into a heading and speed. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MAXIMUM_TILT
public static final double MAXIMUM_TILT
- See Also:
- Constant Field Values
TiltDriveAlgorithm
public TiltDriveAlgorithm()
convert
public void convert(double x,
double y,
double z)
- Description copied from class:
DriveAlgorithm
- Converts the input coordinates into a heading and speed. Input coordinates
are dependent on the method used, for example, they can be accelerometer coordinates
or a point in a view.
- Specified by:
convert
in class DriveAlgorithm
- Parameters:
x
- First coordinate in the input coordinates.y
- Second coordinate in the input coordinates.z
- Third coordinate in the input coordinates.