TrajectorySegment Class Reference
[Trajectory Generator]

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

#include <trgen.h>

Inheritance diagram for TrajectorySegment:

Inheritance graph
[legend]

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
 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
TrajectorySegment
splitAt (double distance, Point *newEnd)=0
 Splits the segment at the specified point.
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 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
double acc
 Acceleration at this segment [$\mathrm m\cdot \mathrm s^{-2}$].


Detailed Description

Abstract class for a segment of the trajectory.

Definition at line 98 of file trgen.h.


Member Function Documentation

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

Length of the segment in meters.

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

Referenced by getUnifiedLength().

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.

Definition at line 125 of file trgen.h.

References getLength().

Referenced by startAt().

Here is the call graph for this function:

Here is the caller graph for this function:

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::Arc, and Segment::Turn.

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::Arc, and Segment::Turn.

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::Arc, and Segment::Turn.

Referenced by Trajectory::splitSegment().

Here is the caller graph for this function:

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.

Definition at line 164 of file trgen.h.

References acc, getUnifiedLength(), t1, t2, v1, and v2.

Referenced by Trajectory::addTurns().

Here is the call graph for this function:

Here is the caller graph for this function:

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::Arc, and Segment::Turn.

Referenced by Trajectory::addTurns(), and Trajectory::getSegRefPos().

Here is the caller graph for this function:

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.

Definition at line 188 of file trgen.h.

References t1, and t2.


Member Data Documentation

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.

Definition at line 102 of file trgen.h.

Referenced by containsTime(), Segment::Turn::getRefPos(), Segment::Arc::getRefPos(), Segment::Line::getRefPos(), getT1(), and startAt().

double TrajectorySegment::maxv

Maximum speed of the segment.

Determined by constraints of the whole trajectory.

Definition at line 106 of file trgen.h.

Referenced by Segment::Turn::setMaxV(), Segment::Arc::setMaxV(), and Segment::Line::setMaxV().


The documentation for this class was generated from the following file:
Generated on Thu Sep 13 11:28:30 2007 for DCE-Eurobot by  doxygen 1.5.3