|
| Spline (statespace::ConstStateSpacePtr _stateSpace, double _startTime=0.) |
| Constructs an empty trajectory. More...
|
|
virtual | ~Spline () |
|
void | addSegment (const Eigen::MatrixXd &_coefficients, double _duration, const statespace::StateSpace::State *_startState) |
| Add a segment to the end of this trajectory that starts at _startState , lasts for _duration , and is defined by a polynomial in the tangent space of _startState . More...
|
|
void | addSegment (const Eigen::MatrixXd &_coefficients, double _duration) |
| Adds a segment to the end of the trajectory while preserving C0 continuity. More...
|
|
std::size_t | getNumSegments () const |
| Gets the number of segments in this spline. More...
|
|
statespace::ConstStateSpacePtr | getStateSpace () const override |
| Gets the StateSpace that this trajectory is defined in. More...
|
|
std::size_t | getNumDerivatives () const override |
| Gets an upper bound on the number of non-zero derivatives available in this parameterization. More...
|
|
double | getStartTime () const override |
| Time at which the trajectory starts. More...
|
|
double | getEndTime () const override |
| Time at which the trajectory ends. More...
|
|
double | getDuration () const override |
| Duration of the trajectory. More...
|
|
void | evaluate (double _t, statespace::StateSpace::State *_state) const override |
| Evaluates the state of the trajectory at time _t and store the result in a _state allocated by getStateSpace() . More...
|
|
void | evaluateDerivative (double _t, int _derivative, Eigen::VectorXd &_tangentVector) const override |
| Evaluates the derivative of the trajectory at time _t . More...
|
|
std::size_t | getNumWaypoints () const |
| Gets the number of waypoints. More...
|
|
void | getWaypoint (std::size_t _index, statespace::StateSpace::State *state) const |
| Gets a waypoint. More...
|
|
double | getWaypointTime (std::size_t _index) const |
| Gets the time of a waypoint. More...
|
|
void | getWaypointDerivative (std::size_t _index, int _derivative, Eigen::VectorXd &_tangentVector) const |
| Gets the derivative of a waypoint. More...
|
|
double | getSegmentDuration (std::size_t _index) const |
| Gets the duration of a segment. More...
|
|
const Eigen::MatrixXd & | getSegmentCoefficients (std::size_t _index) const |
| Gets the coefficients of a segment. More...
|
|
const aikido::statespace::StateSpace::State * | getSegmentStartState (std::size_t _index) const |
| Gets the start state of a segment. More...
|
|
virtual | ~Trajectory ()=default |
|
Polynomial spline trajectory defined in a StateSpace
.
The trajectory is represented as a sequence of polynomial segments between knot points. Each segment is defined by a start state, a duration, and polynomial coefficients for each dimension of the StateSpace
. The polynomial for a segment is parameterized in the tangent space of its start state.
It is possible to avoid singularities in expMap
and logMap
by starting a new segment whenever passing near a singularity. Such a parameterization always exists because Lie groups are locally Euclidean.
This trajectory does not guarantee any continuity (not even C0). It is the responsibility of the user to pass in continuous spline coefficients if continuity is desired.
void aikido::trajectory::Spline::addSegment |
( |
const Eigen::MatrixXd & |
_coefficients, |
|
|
double |
_duration |
|
) |
| |
Adds a segment to the end of the trajectory while preserving C0 continuity.
This is a helper function that calls the three-argument overload of this function with _startState
set to the end of the trajectory. As a result, the trajectory must be non-empty.
Note that repeated calls to this function may accumulate numerical imprecision from repeated polynomial evaluation. We suggest calling the overload of the function that accepts an explicit start state if it is possible to do so.
- Parameters
-
_coefficients | Polynomial coefficients |
_duration | Duration of this segment, must be positive |
void aikido::trajectory::Spline::addSegment |
( |
const Eigen::MatrixXd & |
_coefficients, |
|
|
double |
_duration, |
|
|
const statespace::StateSpace::State * |
_startState |
|
) |
| |
Add a segment to the end of this trajectory that starts at _startState
, lasts for _duration
, and is defined by a polynomial in the tangent space of _startState
.
The _coefficients
matrix is a (num dimensions) x (num coefficients) matrix where the i-th row defines polynomial coefficients for the i-th dimension of the state space and the j-th column defines the coefficient for the j-th power of time parameter. For example, element (3, 2) defines the polynomial coefficient on t^2 for the third state space dimension.
Polynomial coefficients are defined in the tangent space of the segment's start state, given by _startState
. The polynomial encoded by _coefficients
will be evaluated at times [ 0, _duration
]. Segments may have heterogeneous polynomial orders, and thus, coefficient matrices with differing numbers of columns.
Note that the value of _startState
is not checked for C0 continuity, nor are the derivatives evaluated at the start of the segment checked for higher-order continuity. It is the responsibility of the user to pass in continuous spline coefficients if continuity is desired.
- Parameters
-
_coefficients | Polynomial coefficients |
_duration | Duration of this segment, must be positive |
_startState | Start state of the segment |