Represents a qunitic polynomial in 3D. More...
#include </home/thodoris/src/ompl/demos/multicopter/CommonMath/Trajectory.h>
Public Member Functions | |
| Trajectory (std::vector< Vec3 > coeffs, double startTime, double endTime) | |
| Constructor. | |
| Trajectory (Vec3 c0, Vec3 c1, Vec3 c2, Vec3 c3, Vec3 c4, Vec3 c5, double startTime, double endTime) | |
| Constructor. | |
| Vec3 | GetVelocity (double t) const |
| Returns the 3D velocity of the polynomial at a given time. | |
| Vec3 | GetValue (double t) const |
| Returns the 3D position of the polynomial at a given time. | |
| std::vector< Vec3 > | GetCoeffs () |
| Return the 3D vector of coefficients. | |
| double | GetStartTime () const |
| Return the start time of the trajectory. | |
| double | GetEndTime () const |
| Return the end time of the trajectory. | |
| std::vector< Vec3 > | GetDerivativeCoeffs () const |
| Returns the coefficient of the time derivative of the trajectory. | |
| Trajectory | operator- (const Trajectory rhs) |
| Returns the difference between this trajectory and a given trajectory. | |
| Vec3 | operator[] (int i) const |
| Returns the i-th 3D vector of coefficients. | |
Detailed Description
Represents a qunitic polynomial in 3D.
The polynomial is a function of time and is of the form c[0]*t^5 + c[1]*t^4 + c[2]*t^3 + c[3]*t^2 + c[4]*t + c[5] where each coefficient is a vector with three dimensions. The polynomial is only defined between given start and end times.
Definition at line 34 of file Trajectory.h.
Constructor & Destructor Documentation
◆ Trajectory() [1/2]
|
inline |
Constructor.
- Parameters
-
coeffs The six 3D coefficients defining the polynomial. The coefficients are ordered such that coeffs[0] corresponds to t^5, coeffs[1] to t^4 and so forth. startTime The earliest time at which the polynomial is defined endTime The latest time at which the polynomial is defined
Definition at line 45 of file Trajectory.h.
◆ Trajectory() [2/2]
|
inline |
Constructor.
- Parameters
-
c0 Coefficients for t^5 c1 Coefficients for t^4 c2 Coefficients for t^3 c3 Coefficients for t^2 c4 Coefficients for t c5 Constant terms startTime The earliest time at which the polynomial is defined endTime The latest time at which the polynomial is defined
Definition at line 63 of file Trajectory.h.
Member Function Documentation
◆ GetCoeffs()
|
inline |
Return the 3D vector of coefficients.
Definition at line 96 of file Trajectory.h.
◆ GetDerivativeCoeffs()
|
inline |
Returns the coefficient of the time derivative of the trajectory.
- Returns
- A 5D vector of 3D coefficients representing the time derivative of the trajectory, where derivCoeffs[0] is a 3D vector of coefficients corresponding to t^4, derivCoeffs[1] corresponds to t^3, etc.
Definition at line 119 of file Trajectory.h.
◆ GetEndTime()
|
inline |
Return the end time of the trajectory.
Definition at line 108 of file Trajectory.h.
◆ GetStartTime()
|
inline |
Return the start time of the trajectory.
Definition at line 102 of file Trajectory.h.
◆ GetValue()
|
inline |
Returns the 3D position of the polynomial at a given time.
- Parameters
-
t Time at which to evaluate the polynomial (must be between startTime and endTime)
- Returns
- Position of trajectory at time t
Definition at line 87 of file Trajectory.h.
◆ GetVelocity()
|
inline |
Returns the 3D velocity of the polynomial at a given time.
- Parameters
-
t Time at which to evaluate the polynomial (must be between startTime and endTime)
- Returns
- Position of trajectory at time t
Definition at line 74 of file Trajectory.h.
◆ operator-()
|
inline |
Returns the difference between this trajectory and a given trajectory.
The trajectory that is returned is only defined at times where both trajectories are defined (both trajectories must overlap in time). The returned trajectory is the relative position of the two trajectories in time.
Definition at line 137 of file Trajectory.h.
◆ operator[]()
|
inline |
Returns the i-th 3D vector of coefficients.
Definition at line 146 of file Trajectory.h.
The documentation for this class was generated from the following file:
- demos/multicopter/CommonMath/Trajectory.h