orbotix.robot.base
Class TiltDriveAlgorithm

java.lang.Object
  extended by orbotix.robot.base.DriveAlgorithm
      extended by 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

Nested Class Summary
 
Nested classes/interfaces inherited from class orbotix.robot.base.DriveAlgorithm
DriveAlgorithm.OnConvertListener
 
Field Summary
static double MAXIMUM_TILT
           
 
Fields inherited from class orbotix.robot.base.DriveAlgorithm
adjustedHeading, deadZoneDelta, heading, headingOffset, MAX_COORDINATES, speed, speedScale, stopPosition
 
Constructor Summary
TiltDriveAlgorithm()
           
 
Method Summary
 void convert(double x, double y, double z)
          Converts the input coordinates into a heading and speed.
 
Methods inherited from class orbotix.robot.base.DriveAlgorithm
setOnConvertListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAXIMUM_TILT

public static final double MAXIMUM_TILT
See Also:
Constant Field Values
Constructor Detail

TiltDriveAlgorithm

public TiltDriveAlgorithm()
Method Detail

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.