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

Represents a motion path made up of a series of Paths. More...

Public Member Functions

 CompositePath ()
 default path is empty
 
 CompositePath (std::unique_ptr< Path > path)
 constructors with one path
 
template<typename... Args>
 CompositePath (std::unique_ptr< Path > path, Args... args)
 
void append (std::unique_ptr< Path > path)
 Append the path to the end of the CompositePath.
 
template<typename... Args>
void append (std::unique_ptr< Path > path, Args... args)
 
virtual bool hit (const Geometry2d::ShapeSet &shape, RJ::Seconds startTimeIntoPath, RJ::Seconds *hitTime) const override
 Returns true if the path hits an obstacle. More...
 
virtual void draw (DebugDrawer *constdebug_drawer, const QColor &color=Qt::black, const QString &layer="Motion") const override
 Draws the path. More...
 
virtual RJ::Seconds getDuration () const override
 Returns how long it would take for the entire path to be traversed. More...
 
virtual std::unique_ptr< PathsubPath (RJ::Seconds startTime=0ms, RJ::Seconds endTime=RJ::Seconds::max()) const override
 Returns a subPath. More...
 
virtual RobotInstant start () const override
 Start instant of the path.
 
virtual RobotInstant end () const override
 Destination 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...
 
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 t) 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 motion path made up of a series of Paths.

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::CompositePath:
+ Collaboration diagram for Planning::CompositePath:

Member Function Documentation

◆ draw()

void Planning::CompositePath::draw ( DebugDrawer debug_drawer,
const QColor &  color = Qt::black,
const QString &  layer = "Motion" 
) const
overridevirtual

Draws the path.

The default implementation adds a DebugRobotPath to the SystemState that interpolates points along the path.

Parameters
debug_drawerThe SystemState to draw the path on
colorThe color the path should be drawn
layerThe layer to draw the path on

Reimplemented from Planning::Path.

◆ getDuration()

RJ::Seconds Planning::CompositePath::getDuration ( ) const
overridevirtual

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::CompositePath::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()

unique_ptr< Path > Planning::CompositePath::subPath ( RJ::Seconds  startTime = 0ms,
RJ::Seconds  endTime = RJ::Seconds::max() 
) 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: