![]() |
GT RoboCup SSL
Soccer software, robot firmware
|
Represents a motion path as a series of {pos, vel} pairs. More...
Classes | |
struct | Entry |
Each entry in InterpolatedPath is a MotionInstant and the time that the robot should be at that position and velocity. More... | |
Public Member Functions | |
InterpolatedPath () | |
default path is empty | |
InterpolatedPath (Geometry2d::Point p0) | |
constructor with a single point | |
InterpolatedPath (Geometry2d::Point p0, Geometry2d::Point p1) | |
constructor from two points | |
void | addInstant (RJ::Seconds time, MotionInstant instant) |
Adds an instant at the end of the path for the given time. More... | |
virtual RobotInstant | start () const override |
Start instant of the path. | |
virtual RobotInstant | end () const override |
Destination instant of the path. | |
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 std::unique_ptr< Path > | subPath (RJ::Seconds startTime=RJ::Seconds::zero(), RJ::Seconds endTime=RJ::Seconds::max()) const override |
Returns a subPath. More... | |
virtual void | draw (DebugDrawer *constdebug_drawer, const QColor &color, const QString &layer) 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< Path > | clone () const override |
Returns a deep copy of the Path. | |
bool | empty () const |
void | clear () |
Erase all path contents. | |
float | length (unsigned int start=0) const |
Calulates the length of the path. More... | |
float | length (unsigned int start, unsigned int end) const |
Calulates the length of the path. More... | |
float | length (Geometry2d::Point pt) const |
Returns the length of the path from the closet point found to pt. | |
size_t | size () const |
Returns number of waypoints. | |
int | nearestIndex (Geometry2d::Point pt) const |
Geometry2d::Segment | nearestSegment (Geometry2d::Point pt) const |
returns the nearest segement of pt to the path | |
float | distanceTo (Geometry2d::Point pt) const |
RJ::Seconds | getTime (int index) const |
Estimates how long it would take for the robot to get to a certain point in the path using Trapezoidal motion. More... | |
![]() | |
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... | |
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< ConstPathIterator > | iterator (RJ::Time startTime, RJ::Seconds deltaT) const |
void | slow (float multiplier, RJ::Seconds timeInto=RJ::Seconds::zero()) |
Static Public Member Functions | |
static std::unique_ptr< Path > | emptyPath (Geometry2d::Point pos) |
Public Attributes | |
std::vector< Entry > | waypoints |
Protected Member Functions | |
virtual std::optional< RobotInstant > | eval (RJ::Seconds t) const override |
Additional Inherited Members | |
![]() | |
double | evalRate = 1.0 |
RJ::Time | _startTime |
std::optional< QString > | _debugText |
Represents a motion path as a series of {pos, vel} pairs.
The path represents a function of position given time that the robot should follow. A line-segment-based path comes from the planner, then we use cubic bezier curves to interpolate and smooth it out. This is done via the evaulate() method.
|
inline |
Adds an instant at the end of the path for the given time.
Time should not bet less than the last time.
|
overridevirtual |
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 from Planning::Path.
|
overridevirtual |
Returns how long it would take for the entire path to be traversed.
Implements Planning::Path.
RJ::Seconds Planning::InterpolatedPath::getTime | ( | int | index | ) | const |
Estimates how long it would take for the robot to get to a certain point in the path using Trapezoidal motion.
index | Index of the point on the path |
|
overridevirtual |
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 |
Implements Planning::Path.
float Planning::InterpolatedPath::length | ( | unsigned int | start = 0 | ) | const |
Calulates the length of the path.
[in] | start | Index of point in path to use at start point. |
float Planning::InterpolatedPath::length | ( | unsigned int | start, |
unsigned int | end | ||
) | const |
Calulates the length of the path.
[in] | start | Index of point in path to use at start point. |
[in] | end | Index of point in path to use at end point. |
|
overridevirtual |
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. |
Implements Planning::Path.