GT RoboCup SSL
Soccer software, robot firmware
Planning::TrapezoidalPath Class Reference

Represents a straight-line path with a trapezoidal velocity profile. More...

Public Member Functions

 TrapezoidalPath (Geometry2d::Point startPos, double startSpeed, Geometry2d::Point endPos, double endSpeed, const MotionConstraints constraints)
 
virtual bool hit (const Geometry2d::ShapeSet &obstacles, RJ::Seconds initialTime, RJ::Seconds *hitTime) const override
 Returns true if the path hits an obstacle. More...
 
virtual RJ::Seconds getDuration () const override
 Returns how long it would take for the entire path to be traversed. More...
 
double maxSpeed () const
 
virtual std::unique_ptr< PathsubPath (RJ::Seconds startTime, RJ::Seconds endTime) const override
 Returns a subPath. More...
 
virtual RobotInstant end () const override
 Destination instant of the path.
 
virtual RobotInstant start () const override
 Start instant of the path.
 
virtual std::unique_ptr< Pathclone () const override
 Returns a deep copy of the Path.
 
- Public Member Functions inherited from Planning::Path
 Path (RJ::Time startTime=RJ::now())
 
std::optional< RobotInstantevaluate (RJ::Seconds t) const
 This method evaluates the path at a given time and returns the target angle, position, and velocity of the robot. More...
 
virtual void draw (DebugDrawer *const debug_drawer, const QColor &color=Qt::black, const QString &layer="Motion") const
 Draws the path. More...
 
RJ::Seconds getSlowedDuration () const
 
virtual void setDebugText (QString string)
 
virtual void drawDebugText (DebugDrawer *debug_drawer, const QColor &color=Qt::darkCyan, const QString &layer="PathDebugText") const
 
virtual RJ::Time startTime () const
 The time the path starts at.
 
virtual void setStartTime (RJ::Time t)
 
virtual bool pathsIntersect (const std::vector< DynamicObstacle > &paths, RJ::Time startTime, Geometry2d::Point *hitLocation, RJ::Seconds *hitTime) const
 
virtual std::unique_ptr< ConstPathIteratoriterator (RJ::Time startTime, RJ::Seconds deltaT) const
 
void slow (float multiplier, RJ::Seconds timeInto=RJ::Seconds::zero())
 

Protected Member Functions

virtual std::optional< RobotInstanteval (RJ::Seconds time) const override
 

Additional Inherited Members

- Protected Attributes inherited from Planning::Path
double evalRate = 1.0
 
RJ::Time _startTime
 
std::optional< QString > _debugText
 

Detailed Description

Represents a straight-line path with a trapezoidal velocity profile.

The path represents a function of position given time that the robot should follow. The path is made up of other Paths and can be made up of CompositePaths.

+ Inheritance diagram for Planning::TrapezoidalPath:
+ Collaboration diagram for Planning::TrapezoidalPath:

Member Function Documentation

◆ getDuration()

virtual RJ::Seconds Planning::TrapezoidalPath::getDuration ( ) const
inlineoverridevirtual

Returns how long it would take for the entire path to be traversed.

Returns
The time from start to path completion or infinity if it never stops

Implements Planning::Path.

◆ hit()

bool Planning::TrapezoidalPath::hit ( const Geometry2d::ShapeSet obstacles,
RJ::Seconds  startTimeIntoPath,
RJ::Seconds *  hitTime 
) const
overridevirtual

Returns true if the path hits an obstacle.

Parameters
[in]shapeThe obstacles on the field
[out]hitTimethe approximate time when the path hits an obstacle. If no obstacles are hit, behavior is undefined for the final value.
[in]startTimeIntoPathThe time on the path to start checking from
Returns
true if it hits an obstacle, otherwise false

Implements Planning::Path.

◆ subPath()

std::unique_ptr< Path > Planning::TrapezoidalPath::subPath ( RJ::Seconds  startTime,
RJ::Seconds  endTime 
) const
overridevirtual

Returns a subPath.

Parameters
startTimeThe startTime for from which the subPath should be taken.
endTimeThe endTime from which the subPath should be taken. If it is greater than the duration fo the path, it should go to the end of the path.
Returns
A unique_ptr to the new subPath

Implements Planning::Path.


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