Public Member Functions | Public Attributes | Protected Attributes

TrajectorySegment Class Reference
[Trajectory Generator]

Abstract class for a segment of the trajectory. More...

#include <trgen.h>

Inherited by Segment::Arc, Segment::Line, Segment::Spline, and Segment::Turn.

List of all members.

Public Member Functions

virtual void setMaxV (const TrajectoryConstraints &constr)=0
virtual double getMaxAcc (const TrajectoryConstraints &constr) const
virtual bool isTurn () const
virtual bool isSpline () const
virtual double getDistance (double time) const =0
 TrajectorySegment ()
virtual ~TrajectorySegment ()
virtual double getLength () const =0
 Length of the segment in meters.
virtual double getUnifiedLength () const
 Unified length of the segment, used for calculations of speed and accelerations.
virtual void getPointAt (double distance, Point *p)=0
 Returns the point of the segment, located at the specific distance from the beginning or end.
virtual void shortenBy (double distance, Point *newEnd)=0
 Shorten the segment by a specific length.
virtual TrajectorySegmentsplitAt (double distance, Point *newEnd)=0
 Splits the segment at the specified point.
virtual TrajectorySegmentsplitAtByTime (double time, Point *newEnd)=0
virtual double startAt (double time)
 Sets the starting time of the segment and calculates the ending time according to this.
virtual void getRefPos (double time, Pos &rp)=0
 Return the reference position at some time.
int containsTime (double t)
 Return the position in time of this segment relative to the specified time.
double getT1 ()
 Returns t1.
double getT2 ()
 Returns t2.

Public Attributes

double maxv
 Maximum speed of the segment.
double acc
 Acceleration at this segment [ $\mathrm m\cdot \mathrm s^{-2}$].
double v1
double v2
 speed in the beginning and at the end of the segment
double s
 Helper values for Trajectory::corners2arcs().
double r
double alphahalf

Protected Attributes

double t1
 Time in the beginning and at the end of the segment.
double t2

Detailed Description

Abstract class for a segment of the trajectory.


Constructor & Destructor Documentation

TrajectorySegment::TrajectorySegment (  )  [inline]
virtual TrajectorySegment::~TrajectorySegment (  )  [inline, virtual]

Member Function Documentation

int TrajectorySegment::containsTime ( double  t  )  [inline]

Return the position in time of this segment relative to the specified time.

Parameters:
t Time
Returns:
0 if time t is within this segment, -1 if time t is before this segment, +1 if time t is after this segment.

Here is the caller graph for this function:

virtual double TrajectorySegment::getDistance ( double  time  )  const [pure virtual]
virtual double TrajectorySegment::getLength (  )  const [pure virtual]

Length of the segment in meters.

Implemented in Segment::Line, Segment::Turn, Segment::Spline, and Segment::Arc.

Here is the caller graph for this function:

virtual double TrajectorySegment::getMaxAcc ( const TrajectoryConstraints constr  )  const [inline, virtual]

Reimplemented in Segment::Turn.

virtual void TrajectorySegment::getPointAt ( double  distance,
Point p 
) [pure virtual]

Returns the point of the segment, located at the specific distance from the beginning or end.

Parameters:
[in] distance Distance from the beginning (if positive) or end (if negative) of the segment in meters.
[out] p Pointer to the point to sore the result.

Implemented in Segment::Line, Segment::Turn, Segment::Spline, and Segment::Arc.

virtual void TrajectorySegment::getRefPos ( double  time,
Pos rp 
) [pure virtual]

Return the reference position at some time.

Parameters:
[in] time Time (within this segment time range).
[out] rp Reference position.

Implemented in Segment::Line, Segment::Turn, Segment::Spline, and Segment::Arc.

double TrajectorySegment::getT1 (  )  [inline]

Returns t1.

Here is the caller graph for this function:

double TrajectorySegment::getT2 (  )  [inline]

Returns t2.

Here is the caller graph for this function:

virtual double TrajectorySegment::getUnifiedLength (  )  const [inline, virtual]

Unified length of the segment, used for calculations of speed and accelerations.

Normally, it equal to the real length, buf for TrajectorySegmentTurn (whose length is zero) it represents angle.

Reimplemented in Segment::Turn.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool TrajectorySegment::isSpline (  )  const [inline, virtual]

Reimplemented in Segment::Spline.

virtual bool TrajectorySegment::isTurn (  )  const [inline, virtual]

Reimplemented in Segment::Turn.

virtual void TrajectorySegment::setMaxV ( const TrajectoryConstraints constr  )  [pure virtual]
virtual void TrajectorySegment::shortenBy ( double  distance,
Point newEnd 
) [pure virtual]

Shorten the segment by a specific length.

Parameters:
[in] distance Distance from the end (if positive) of the segment, where should be the end of the segment.
[in] newEnd Point which will be set to the position of the new end.

Implemented in Segment::Line, Segment::Turn, Segment::Spline, and Segment::Arc.

virtual TrajectorySegment* TrajectorySegment::splitAt ( double  distance,
Point newEnd 
) [pure virtual]

Splits the segment at the specified point.

The result will be two segments following the same trajectory as the original one.

Parameters:
[in] distance Distance of the split from the beginning of the segment.
[in] newEnd Point which will be used as a middle point joining the two segments.
Returns:
Pointer to the newly created segment.

Implemented in Segment::Line, Segment::Turn, Segment::Spline, and Segment::Arc.

virtual TrajectorySegment* TrajectorySegment::splitAtByTime ( double  time,
Point newEnd 
) [pure virtual]
virtual double TrajectorySegment::startAt ( double  time  )  [inline, virtual]

Sets the starting time of the segment and calculates the ending time according to this.

Also acceleration is calculated from these times and speed.

Parameters:
time Starting time relative to the start of the whole trajectory (in seconds).
Returns:
Ending time.

Reimplemented in Segment::Spline.

Here is the call graph for this function:


Member Data Documentation

Acceleration at this segment [ $\mathrm m\cdot \mathrm s^{-2}$].

Maximum speed of the segment.

Determined by constraints of the whole trajectory.

Helper values for Trajectory::corners2arcs().

double TrajectorySegment::t1 [protected]

Time in the beginning and at the end of the segment.

The time is relative to the start of the whole trajectory. Units are seconds.

double TrajectorySegment::t2 [protected]

speed in the beginning and at the end of the segment


The documentation for this class was generated from the following file: