public class Path
extends java.lang.Object
Constructor and Description |
---|
Path(double spacing) |
Path(double spacing,
boolean reverse) |
Modifier and Type | Method and Description |
---|---|
void |
addLastPoint() |
void |
addSegment(Vector start,
Vector end)
Adds a path segment to this path
|
double |
calculateCurrDistance(int point) |
double |
calculateCurvatureLookAheadArc(Vector currPos,
double heading,
Vector lookahead,
double lookaheadDistance) |
Vector |
getEndPoint() |
java.util.ArrayList<Vector> |
getRobotPath() |
Vector |
getStartPoint() |
double |
getTotalPathDistance() |
void |
initializePath(double maxVel,
double maxAccel,
double maxVelk)
Initializes the path
|
void |
setCurvatures() |
void |
setDistances() |
void |
setTargetVelocities(double maxVel,
double maxAccel,
double k) |
void |
smooth(double a,
double b,
double tolerance)
Smooths the path using gradient descent
|
public Path(double spacing, boolean reverse)
public Path(double spacing)
public java.util.ArrayList<Vector> getRobotPath()
public Vector getStartPoint()
public Vector getEndPoint()
public void initializePath(double maxVel, double maxAccel, double maxVelk)
maxVel
- maximum robot velocitymaxAccel
- maximum robot accelerationmaxVelk
- maximum turning velocity (between 1-5)public void addSegment(Vector start, Vector end)
start
- starting pointend
- ending pointpublic void smooth(double a, double b, double tolerance)
a
- 1-bb
- smoothing factor (higher = more smooth)tolerance
- convergence tolerance amount (higher = less smoothing)public void addLastPoint()
public double calculateCurrDistance(int point)
public double getTotalPathDistance()
public void setCurvatures()
public void setTargetVelocities(double maxVel, double maxAccel, double k)
public void setDistances()