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

Class which represents a Path with an angle Function attached. More...

Public Member Functions

 AngleFunctionPath (std::unique_ptr< Path > path=nullptr, std::optional< std::function< AngleInstant(MotionInstant)>> angleFunction=std::nullopt)
 
virtual bool hit (const Geometry2d::ShapeSet &obstacles, RJ::Seconds startTimeIntoPath, RJ::Seconds *hitTime) const override
 Returns true if the path hits an obstacle. More...
 
virtual void draw (DebugDrawer *const debug_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=RJ::Seconds::zero(), 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.
 
virtual RJ::Time startTime () const override
 The time the path starts at.
 
virtual void setStartTime (RJ::Time t) override
 
virtual void setDebugText (QString string) override
 
virtual void drawDebugText (DebugDrawer *debug_drawer, const QColor &color=Qt::darkCyan, const QString &layer="PathDebugText") const override
 
- 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 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())
 

Public Attributes

std::unique_ptr< Pathpath
 
std::optional< std::function< AngleInstant(MotionInstant)> > angleFunction
 

Protected Member Functions

virtual std::optional< RobotInstanteval (RJ::Seconds t) const override
 This method evaluates the path at a given time and returns the target position and velocity of the robot. More...
 

Additional Inherited Members

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

Detailed Description

Class which represents a Path with an angle Function attached.

+ Inheritance diagram for Planning::AngleFunctionPath:
+ Collaboration diagram for Planning::AngleFunctionPath:

Member Function Documentation

◆ draw()

virtual void Planning::AngleFunctionPath::draw ( DebugDrawer *const  debug_drawer,
const QColor &  color = Qt::black,
const QString &  layer = "Motion" 
) const
inlineoverridevirtual

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.

◆ eval()

virtual std::optional<RobotInstant> Planning::AngleFunctionPath::eval ( RJ::Seconds  t) const
inlineoverrideprotectedvirtual

This method evaluates the path at a given time and returns the target position and velocity of the robot.

Parameters
tTime (in seconds) since the robot started the path. Throws an exception if t<0
Returns
A MotionInstant containing the position and velocity at the given time if is within the range of the path. If is not within the time range of this path, this method returns std::nullopt.

Implements Planning::Path.

◆ getDuration()

virtual RJ::Seconds Planning::AngleFunctionPath::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()

virtual bool Planning::AngleFunctionPath::hit ( const Geometry2d::ShapeSet obstacles,
RJ::Seconds  startTimeIntoPath,
RJ::Seconds *  hitTime 
) const
inlineoverridevirtual

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

virtual std::unique_ptr<Path> Planning::AngleFunctionPath::subPath ( RJ::Seconds  startTime = RJ::Seconds::zero(),
RJ::Seconds  endTime = RJ::Seconds::max() 
) const
inlineoverridevirtual

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 file: