#include <trgen.h>
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 [![]() |
Definition at line 98 of file trgen.h.
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().
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().
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.
[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.
[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.
[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. |
Implemented in Segment::Line, Segment::Arc, and Segment::Turn.
Referenced by Trajectory::splitSegment().
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.
time | Starting time relative to the start of the whole trajectory (in seconds). |
Definition at line 164 of file trgen.h.
References acc, getUnifiedLength(), t1, t2, v1, and v2.
Referenced by Trajectory::addTurns().
virtual void TrajectorySegment::getRefPos | ( | double | time, | |
Pos & | rp | |||
) | [pure virtual] |
Return the reference position at some time.
[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().
int TrajectorySegment::containsTime | ( | double | t | ) | [inline] |
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().