GT RoboCup SSL
Soccer software, robot firmware
|
Abstract class representing a motion path. More...
Public Member Functions | |
Path (RJ::Time startTime=RJ::now()) | |
std::optional< RobotInstant > | evaluate (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 bool | hit (const Geometry2d::ShapeSet &obstacles, RJ::Seconds startTimeIntoPath, RJ::Seconds *hitTime=nullptr) const =0 |
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 |
Draws the path. More... | |
virtual RJ::Seconds | getDuration () const =0 |
Returns how long it would take for the entire path to be traversed. More... | |
RJ::Seconds | getSlowedDuration () const |
virtual std::unique_ptr< Path > | subPath (RJ::Seconds startTime=0ms, RJ::Seconds endTime=RJ::Seconds::max()) const =0 |
Returns a subPath. More... | |
virtual RobotInstant | start () const =0 |
Start instant of the path. | |
virtual RobotInstant | end () const =0 |
Destination instant of the path. | |
virtual std::unique_ptr< Path > | clone () const =0 |
Returns a deep copy of the Path. | |
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< ConstPathIterator > | iterator (RJ::Time startTime, RJ::Seconds deltaT) const |
void | slow (float multiplier, RJ::Seconds timeInto=RJ::Seconds::zero()) |
Protected Member Functions | |
virtual std::optional< RobotInstant > | eval (RJ::Seconds t) const =0 |
Protected Attributes | |
double | evalRate = 1.0 |
RJ::Time | _startTime |
std::optional< QString > | _debugText |
Abstract class representing a motion path.
|
virtual |
Draws the path.
The default implementation adds a DebugRobotPath to the SystemState that interpolates points along the path.
debug_drawer | The SystemState to draw the path on |
color | The color the path should be drawn |
layer | The layer to draw the path on |
Reimplemented in Planning::AngleFunctionPath, Planning::InterpolatedPath, and Planning::CompositePath.
|
inline |
This method evaluates the path at a given time and returns the target angle, position, and velocity of the robot.
t | Time (in seconds) since the robot started the path. Throws an exception if t<0 |
|
pure virtual |
Returns how long it would take for the entire path to be traversed.
Implemented in Planning::AngleFunctionPath, Planning::InterpolatedPath, Planning::CompositePath, and Planning::TrapezoidalPath.
|
pure virtual |
Returns true if the path hits an obstacle.
[in] | shape | The obstacles on the field |
[out] | hitTime | the approximate time when the path hits an obstacle. If no obstacles are hit, behavior is undefined for the final value. |
[in] | startTimeIntoPath | The time on the path to start checking from |
Implemented in Planning::AngleFunctionPath, Planning::InterpolatedPath, Planning::CompositePath, and Planning::TrapezoidalPath.
|
pure virtual |
Returns a subPath.
startTime | The startTime for from which the subPath should be taken. |
endTime | The 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. |
Implemented in Planning::AngleFunctionPath, Planning::InterpolatedPath, Planning::CompositePath, and Planning::TrapezoidalPath.