Public Member Functions | Public Attributes

Trajectory Class Reference
[Trajectory Generator]

Represents the whole trajectory. More...

#include <trgen.h>

Inherits std::list< TrajectorySegment * >.

Collaboration diagram for Trajectory:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Trajectory (TrajectoryConstraints tc, bool _backward=false)
 Trajectory constructor.
 ~Trajectory ()
void addPoint (double x, double y)
 Adds a new point to the trajectory.
void addTurn (double angle)
double calcLength ()
 Returns the length of the whole trajectory.
bool appendTrajectory (Trajectory &traj, double time)
 Connects to the recent trajectory a new one - traj.
bool prepare (Pos _initPos)
 Prepares the trajectory.
bool getRefPos (double time, Pos &rp)
 Returns reference position of the trajectory at a given time.

Public Attributes

TrajectoryConstraints constr
struct final_heading finalHeading
 Desired heading of the robot at the end of the trajectory.
bool backward
double initialTurnBy

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::Trajectory ( TrajectoryConstraints  tc,
bool  _backward = false 
) [inline]

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:
x 
y 

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the caller graph for this function:


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: