Class representing a multi-dimensional quintic spline segment with a start and end time. More...
#include <quintic_spline_segment.h>
Public Types | |
typedef ScalarType | Scalar |
typedef PosVelAccState< Scalar > | State |
typedef Scalar | Time |
Public Member Functions | |
Time | endTime () const |
void | init (const Time &start_time, const State &start_state, const Time &end_time, const State &end_state) |
Initialize segment from start and end states (boundary conditions). More... | |
QuinticSplineSegment () | |
Creates an empty segment. More... | |
QuinticSplineSegment (const Time &start_time, const State &start_state, const Time &end_time, const State &end_state) | |
Construct segment from start and end states (boundary conditions). More... | |
void | sample (const Time &time, State &state) const |
Sample the segment at a specified time. More... | |
unsigned int | size () const |
Time | startTime () const |
Time | timeFromStart () const |
Private Types | |
typedef std::array< Scalar, 6 > | SplineCoefficients |
Static Private Member Functions | |
static void | computeCoefficients (const Scalar &start_pos, const Scalar &end_pos, const Scalar &time, SplineCoefficients &coefficients) |
static void | computeCoefficients (const Scalar &start_pos, const Scalar &start_vel, const Scalar &end_pos, const Scalar &end_vel, const Scalar &time, SplineCoefficients &coefficients) |
static void | computeCoefficients (const Scalar &start_pos, const Scalar &start_vel, const Scalar &start_acc, const Scalar &end_pos, const Scalar &end_vel, const Scalar &end_acc, const Scalar &time, SplineCoefficients &coefficients) |
static void | generatePowers (int n, const Scalar &x, Scalar *powers) |
static void | sample (const SplineCoefficients &coefficients, const Scalar &time, Scalar &position, Scalar &velocity, Scalar &acceleration) |
static void | sampleWithTimeBounds (const SplineCoefficients &coefficients, const Scalar &duration, const Scalar &time, Scalar &position, Scalar &velocity, Scalar &acceleration) |
Private Attributes | |
std::vector< SplineCoefficients > | coefs_ |
Time | duration_ |
Time | start_time_ |
Time | time_from_start_ |
Class representing a multi-dimensional quintic spline segment with a start and end time.
ScalarType | Scalar type |
Definition at line 48 of file quintic_spline_segment.h.
typedef ScalarType trajectory_interface::QuinticSplineSegment< ScalarType >::Scalar |
Definition at line 51 of file quintic_spline_segment.h.
|
private |
Definition at line 147 of file quintic_spline_segment.h.
typedef PosVelAccState<Scalar> trajectory_interface::QuinticSplineSegment< ScalarType >::State |
Definition at line 53 of file quintic_spline_segment.h.
typedef Scalar trajectory_interface::QuinticSplineSegment< ScalarType >::Time |
Definition at line 52 of file quintic_spline_segment.h.
|
inline |
Creates an empty segment.
size()
on an empty segment will yield zero, and sampling it will yield a state with empty data. Definition at line 61 of file quintic_spline_segment.h.
|
inline |
Construct segment from start and end states (boundary conditions).
Please refer to the init method documentation for the description of each parameter and the exceptions that can be thrown.
Definition at line 74 of file quintic_spline_segment.h.
|
staticprivate |
Definition at line 287 of file quintic_spline_segment.h.
|
staticprivate |
Definition at line 302 of file quintic_spline_segment.h.
|
staticprivate |
Definition at line 330 of file quintic_spline_segment.h.
|
inline |
Definition at line 138 of file quintic_spline_segment.h.
|
inlinestaticprivate |
Definition at line 276 of file quintic_spline_segment.h.
void trajectory_interface::QuinticSplineSegment< ScalarType >::init | ( | const Time & | start_time, |
const State & | start_state, | ||
const Time & | end_time, | ||
const State & | end_state | ||
) |
Initialize segment from start and end states (boundary conditions).
The start and end states need not necessarily be specified all the way to the acceleration level:
start_time | Time at which the segment state equals start_state . |
start_state | State at start_time . |
end_time | Time at which the segment state equals end_state . |
end_state | State at time end_time . |
std::invalid_argument | If the end_time is earlier than start_time or if one of the states is uninitialized. |
Definition at line 185 of file quintic_spline_segment.h.
|
staticprivate |
Definition at line 363 of file quintic_spline_segment.h.
|
inline |
Sample the segment at a specified time.
[start_time, end_time]
interval, spline interpolation takes place, outside it this method will output the start/end states with zero velocity and acceleration.[in] | time | Where the segment is to be sampled. |
[out] | state | Segment state at time . |
Definition at line 116 of file quintic_spline_segment.h.
|
staticprivate |
Definition at line 391 of file quintic_spline_segment.h.
|
inline |
Definition at line 144 of file quintic_spline_segment.h.
|
inline |
Definition at line 135 of file quintic_spline_segment.h.
|
inline |
Definition at line 141 of file quintic_spline_segment.h.
|
private |
Coefficients represent a quintic polynomial like so:
coefs_[0] + coefs_[1]*x + coefs_[2]*x^2 + coefs_[3]*x^3 + coefs_[4]*x^4 + coefs_[5]*x^5
Definition at line 153 of file quintic_spline_segment.h.
|
private |
Definition at line 154 of file quintic_spline_segment.h.
|
private |
Definition at line 155 of file quintic_spline_segment.h.
|
private |
Definition at line 156 of file quintic_spline_segment.h.