|
Autopysta
|
Represents a dynamic trajectory of a moving object. More...
#include <trajectory.h>
Public Member Functions | |
| trajectory (point *_point) | |
| Constructs a trajectory with an initial starting point. | |
| void | push_back (point *p) |
| Adds a point to the trajectory. | |
| point * | add (point *newPoint) |
| Adds a point and returns it. | |
| point * | get (int i) |
| Retrieves a point at the specified index. | |
| int | length () |
| Returns the length of the trajectory. | |
| point * | current () override |
| Gets the current position of the vehicle in the trajectory. | |
| point * | operator[] (int idx) const override |
| Retrieves a point by integer index. | |
| point * | operator[] (double idx) const override |
| Retrieves a point by floating-point index using interpolation. | |
Public Member Functions inherited from generalized_trajectory | |
Represents a dynamic trajectory of a moving object.
This class stores a series of point objects that define the trajectory of a moving vehicle. It allows retrieving points using integer or floating-point indices, and handles extrapolation for negative indices.
| trajectory::trajectory | ( | point * | _point | ) |
Constructs a trajectory with an initial starting point.
| _point | Initial point of the trajectory. |
Adds a point and returns it.
| newPoint | Pointer to the new point to add. |
|
overridevirtual |
Gets the current position of the vehicle in the trajectory.
Implements generalized_trajectory.
| point * trajectory::get | ( | int | i | ) |
Retrieves a point at the specified index.
| i | Index of the point to retrieve. |
| int trajectory::length | ( | ) |
Returns the length of the trajectory.
|
overridevirtual |
Retrieves a point by floating-point index using interpolation.
| idx | Floating-point index for interpolating the point. |
Implements generalized_trajectory.
|
overridevirtual |
Retrieves a point by integer index.
| idx | Index of the point to retrieve. |
Implements generalized_trajectory.
| void trajectory::push_back | ( | point * | p | ) |
Adds a point to the trajectory.
| p | Pointer to the point to add. |