public class TrajectoryPlanner extends Object
Modifier and Type | Field and Description |
---|---|
(package private) double |
actualPhi
Actual rotation of agent during trajectory calculations.
|
(package private) Vector3D |
actualPos
Actual position of agent during trajectory calculations.
|
static double |
ANGLE_DEVIATION_A |
static double |
ANGLE_DEVIATION_B |
static double |
ANGLE_DEVIATION_C |
static double |
ANGLE_DEVIATION_D |
static double |
ANGLE_DEVIATION_E |
static double |
DISTANCE_DEVIATION |
(package private) Vector3D |
finalPosition
Final position of agent.
|
(package private) double |
finalRotation
Final rotation of agent.
|
(package private) Annotation |
lastMove
Stores the last move in the trajectory for purpose of compatibility
testing of the next move.
|
(package private) LinkedList<Annotation> |
moves
Queue of moves used to store partial trajectories calculated by rotate() and walk() methods.
|
(package private) LinkedList<Vector3D> |
obstacles
Contains all possible obstcles on trajectory.
|
(package private) ArrayList<Annotation> |
rotation
Contains all moves tagged as rotation.
|
(package private) Vector3D |
startPosition
Starting position of agent.
|
(package private) double |
startRotation
Starting rotation of agent.
|
(package private) Annotation |
stdWalk
Annotation of the move that is standard for walking.
|
(package private) Trajectory |
trajectory
Represents fastest calculated trajectory.
|
(package private) LinkedList<Trajectory> |
trajectoryPlans
Contains all calculated trajectories.
|
(package private) ArrayList<Annotation> |
walk
Contains all moves tagged as walk.
|
Constructor and Description |
---|
TrajectoryPlanner(Vector3D startPosition,
double startRotation,
Vector3D finalPosition,
double finalRotation,
LinkedList<Vector3D> obstacles)
Constructs the object of this class and calls all methods needed to compute the optimal trajectory.
|
Modifier and Type | Method and Description |
---|---|
private Vector3D |
findBypassPoint(Vector3D position,
double rotation,
Vector3D obstacle)
Finds bypass point of given obstacle considering also other obstacles.
|
double |
getDistance()
Sums the walk length of all moves of operational trajectory returning distance to by walked.
|
Trajectory |
getTrajectory()
Returns the fastest calculated trajectory.
|
Trajectory |
pickBestTrajectory()
Sums the move durations of all trajectories and returns the one with shortest duration.
|
private void |
plan(Trajectory t)
Plans the trajectory using rotations and walk moves, bypassing obstacles.
|
private double |
rotate(double angle,
double deviation)
Adjusts the angle and calls rotateQueue() method.
|
private double |
rotateQueue(double angle,
ArrayList<Annotation> list,
double deviation)
Calculates the trajectory of rotating.
|
private void |
setFinal(Vector3D position,
double rotation)
Sets final position and rotation of the agent.
|
private void |
setStart(Vector3D position,
double rotation)
Sets start position and rotation of the agent.
|
private void |
walk(double distance)
Calculates the trajectory of walking.
|
Trajectory trajectory
ArrayList<Annotation> rotation
ArrayList<Annotation> walk
LinkedList<Vector3D> obstacles
LinkedList<Trajectory> trajectoryPlans
LinkedList<Annotation> moves
Vector3D startPosition
double startRotation
Vector3D finalPosition
double finalRotation
Vector3D actualPos
double actualPhi
public static final double ANGLE_DEVIATION_A
public static final double ANGLE_DEVIATION_B
public static final double ANGLE_DEVIATION_C
public static final double ANGLE_DEVIATION_D
public static final double ANGLE_DEVIATION_E
public static final double DISTANCE_DEVIATION
Annotation stdWalk
Annotation lastMove
public TrajectoryPlanner(Vector3D startPosition, double startRotation, Vector3D finalPosition, double finalRotation, LinkedList<Vector3D> obstacles)
startPosition
- startRotation
- finalPosition
- finalRotation
- obstacles
- private void setStart(Vector3D position, double rotation)
position
- rotation
- private void setFinal(Vector3D position, double rotation)
position
- rotation
- private void plan(Trajectory t)
trajectory
- to fill with movesprivate double rotate(double angle, double deviation)
angle
- to rotateacceptable
- deviationprivate void walk(double distance)
distance
- private double rotateQueue(double angle, ArrayList<Annotation> list, double deviation)
distance
- public Trajectory pickBestTrajectory()
public Trajectory getTrajectory()
public double getDistance()