Represents the whole trajectory.
More...
#include <trgen.h>
Inherits std::list< TrajectorySegment * >.
List of all members.
Detailed Description
Represents the whole trajectory.
When a new trajectory is created (by Trajectory() constructor), addPoint() should be used to add points, the trajectory should go through. After all points are added, a call to prepare() uses these points to construct optimized trajectory and find the speeds along the trajectory. After the trajectory is prepared, you can call getRefPos(), to get the reference position at a specific time.
Constructor & Destructor Documentation
Trajectory constructor.
- Parameters:
-
| tc | Trajectory constraints |
| _backward | Whether the trajectory should be followed in backward direction. |
Trajectory::~Trajectory |
( |
|
) |
[inline] |
Member Function Documentation
void Trajectory::addPoint |
( |
double |
x, |
|
|
double |
y | |
|
) |
| | [inline] |
Adds a new point to the trajectory.
- Parameters:
-
void Trajectory::addTurn |
( |
double |
angle |
) |
|
bool Trajectory::appendTrajectory |
( |
Trajectory & |
traj, |
|
|
double |
time | |
|
) |
| | |
Connects to the recent trajectory a new one - traj
.
It must satisfy some demands e.g. being prepared.
- Parameters:
-
| traj | new trajectory |
| time | on the recent trajectory to find the point where to join trajectories. |
- Returns:
- true if the action succeeded
double Trajectory::calcLength |
( |
|
) |
|
Returns the length of the whole trajectory.
bool Trajectory::getRefPos |
( |
double |
time, |
|
|
Pos & |
rp | |
|
) |
| | |
Returns reference position of the trajectory at a given time.
- Parameters:
-
[in] | time | Time from the beginning of the trajectory. |
[out] | rp | Returned reference position. |
- Returns:
- True if the time is after the trajectory ends or error. False otherwise.
bool Trajectory::prepare |
( |
Pos |
_initPos |
) |
|
Prepares the trajectory.
It converts points added by addPoint() to line segments (Line). Then it replaces by sharp corners by arcs (see corners2arcs()), then it adds turns at the begin and end and finally it calculates speeds in the different parts of the trajectory by adding acceleration and decceleration segments (see calcSpeeds()).
- Parameters:
-
| _initPos | The point where the trajectory should start. Typically the current robot position. |
- Returns:
- True in case of success, false when the trajectory has only one point and initPos is already equal to that point.
Member Data Documentation
Desired heading of the robot at the end of the trajectory.
The documentation for this class was generated from the following files: