|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorbotix.robot.base.DriveAlgorithm
public abstract class DriveAlgorithm
Abstract class that defines the behavior for drive algorithms that converts input coordinates to a heading and angle for a device.
Nested Class Summary | |
---|---|
static interface |
DriveAlgorithm.OnConvertListener
Interface for listener to receive conversion notifications. |
Field Summary | |
---|---|
double |
adjustedHeading
The calculated heading adjusted for any heading offset present |
double[] |
deadZoneDelta
The deltas in the input coordinates around the stopped position that is still considered zero speed. |
double |
heading
The calculated heading |
double |
headingOffset
The heading offset (in degrees) used to correct the heading to the adjustedHeading. |
static int |
MAX_COORDINATES
Maximum number of input coordinates. |
double |
speed
The calculated speed |
double |
speedScale
A scale factory between 0.0 to 1.0 to limit the speed |
double[] |
stopPosition
The point in the input coordinates that is considered the stopped position. |
Constructor Summary | |
---|---|
DriveAlgorithm()
|
Method Summary | |
---|---|
abstract void |
convert(double coord1,
double coord2,
double coord3)
Converts the input coordinates into a heading and speed. |
void |
setOnConvertListener(DriveAlgorithm.OnConvertListener listener)
Method to register an OnConvertListener. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAX_COORDINATES
public double heading
public double headingOffset
public double adjustedHeading
public double speed
public double speedScale
public double[] stopPosition
public double[] deadZoneDelta
Constructor Detail |
---|
public DriveAlgorithm()
Method Detail |
---|
public void setOnConvertListener(DriveAlgorithm.OnConvertListener listener)
listener
- A OnConvertListener object.public abstract void convert(double coord1, double coord2, double coord3)
coord1
- First coordinate in the input coordinates.coord2
- Second coordinate in the input coordinates.coord3
- Third coordinate in the input coordinates.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |