public class FalconPathPlanner
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
double[][] |
heading |
double[][] |
leftPath |
double[][] |
nodeOnlyPath |
double[][] |
origCenterVelocity |
double[][] |
origLeftVelocity |
double[][] |
origPath |
double[][] |
origRightVelocity |
double[][] |
rightPath |
double[][] |
smoothCenterVelocity |
double[][] |
smoothLeftVelocity |
double[][] |
smoothPath |
double[][] |
smoothRightVelocity |
Constructor and Description |
---|
FalconPathPlanner(double[][] path)
Constructor, takes a Path of Way Points defined as a double array of column vectors
representing the global cartesian points of the path in {x,y} coordinates.
|
Modifier and Type | Method and Description |
---|---|
void |
calculate(double totalTime,
double timeStep,
double robotTrackWidth)
This code will calculate a smooth path based on the program parameters.
|
static double[][] |
doubleArrayCopy(double[][] arr)
Performs a deep copy of a 2 Dimensional Array looping thorough each element in the 2D array
BigO: Order N x M
|
static double[] |
getXVector(double[][] arr)
Returns the first column of a 2D array of doubles
|
static double[] |
getYVector(double[][] arr)
Returns the second column of a 2D array of doubles
|
double[][] |
inject(double[][] orig,
int numToInject)
Method upsamples the Path by linear injection.
|
int[] |
injectionCounter2Steps(double numNodeOnlyPoints,
double maxTimeToComplete,
double timeStep)
This method calculates the optimal parameters for determining what amount of nodes to inject
into the path to meet the time restraint.
|
void |
leftRight(double[][] smoothPath,
double robotTrackWidth)
Calculates the left and right wheel paths based on robot track width
Big O: 2N
|
static void |
main(java.lang.String[] args) |
static double[][] |
nodeOnlyWayPoints(double[][] path)
reduces the path into only nodes which change direction.
|
void |
poofExample() |
static void |
print(double[] path) |
static void |
print(double[][] path)
Prints Cartesian Coordinates to the System Output as Column Vectors in the Form X Y
|
void |
setPathAlpha(double alpha) |
void |
setPathBeta(double beta) |
void |
setPathTolerance(double tolerance) |
void |
setVelocityAlpha(double alpha) |
void |
setVelocityBeta(double beta) |
double[][] |
smoother(double[][] path,
double weight_data,
double weight_smooth,
double tolerance)
Optimization algorithm, which optimizes the data points in path to create a smooth
trajectory.
|
static double[][] |
transposeVector(double[][] arr) |
public double[][] origPath
public double[][] nodeOnlyPath
public double[][] smoothPath
public double[][] leftPath
public double[][] rightPath
public double[][] origCenterVelocity
public double[][] origRightVelocity
public double[][] origLeftVelocity
public double[][] smoothCenterVelocity
public double[][] smoothRightVelocity
public double[][] smoothLeftVelocity
public double[][] heading
public FalconPathPlanner(double[][] path)
path
- public static void print(double[] path)
public static void print(double[][] path)
path
- public static double[][] doubleArrayCopy(double[][] arr)
arr
- public double[][] inject(double[][] orig, int numToInject)
orig
- numToInject
- public double[][] smoother(double[][] path, double weight_data, double weight_smooth, double tolerance)
path
- weight_data
- weight_smooth
- tolerance
- public static double[][] nodeOnlyWayPoints(double[][] path)
path
- public int[] injectionCounter2Steps(double numNodeOnlyPoints, double maxTimeToComplete, double timeStep)
numNodeOnlyPoints
- maxTimeToComplete
- timeStep
- public void leftRight(double[][] smoothPath, double robotTrackWidth)
smoothPath
- - center smooth path of robotrobotTrackWidth
- - width between left and right wheels of robot of skid steer chassis.public static double[] getXVector(double[][] arr)
arr
- 2D array of doublespublic static double[] getYVector(double[][] arr)
arr
- 2D array of doublespublic static double[][] transposeVector(double[][] arr)
public void setPathAlpha(double alpha)
public void setPathBeta(double beta)
public void setPathTolerance(double tolerance)
public void setVelocityAlpha(double alpha)
public void setVelocityBeta(double beta)
public void calculate(double totalTime, double timeStep, double robotTrackWidth)
totalTime
- - time the user wishes to complete the path in seconds. (this is the maximum
amount of time the robot is allowed to take to traverse the path.)timeStep
- - the frequency at which the robot controller is running on the robot.robotTrackWidth
- - distance between left and right side wheels of a skid steer chassis.
Known as the track width.public static void main(java.lang.String[] args)
public void poofExample()