Aikido
aikido::trajectory::Trajectory Class Referenceabstract

Time-parameterized path in a StateSpace. More...

#include <aikido/trajectory/Trajectory.hpp>

Inheritance diagram for aikido::trajectory::Trajectory:
aikido::trajectory::BSpline aikido::trajectory::Interpolated aikido::trajectory::Spline

Public Member Functions

virtual ~Trajectory ()=default
 
virtual statespace::ConstStateSpacePtr getStateSpace () const =0
 Gets the StateSpace that this trajectory is defined in. More...
 
virtual std::size_t getNumDerivatives () const =0
 Gets an upper bound on the number of non-zero derivatives available in this parameterization. More...
 
virtual double getDuration () const =0
 Duration of the trajectory. More...
 
virtual double getStartTime () const =0
 Time at which the trajectory starts. More...
 
virtual double getEndTime () const =0
 Time at which the trajectory ends. More...
 
virtual void evaluate (double _t, statespace::StateSpace::State *_state) const =0
 Evaluates the state of the trajectory at time _t and store the result in a _state allocated by getStateSpace(). More...
 
virtual void evaluateDerivative (double _t, int _derivative, Eigen::VectorXd &_tangentVector) const =0
 Evaluates the derivative of the trajectory at time _t. More...
 

Public Attributes

TrajectoryMetadata metadata
 Trajectory metadata. More...
 

Detailed Description

Time-parameterized path in a StateSpace.

The parameterization, number of derivatives available, and continuity of this trajectory is defined by the concrete implementation of this class. The interpretation of the time parameter is also implementation defined: it may represent an actual time time or some other value (e.g. arc length under a distance metric).

Constructor & Destructor Documentation

◆ ~Trajectory()

virtual aikido::trajectory::Trajectory::~Trajectory ( )
virtualdefault

Member Function Documentation

◆ evaluate()

virtual void aikido::trajectory::Trajectory::evaluate ( double  _t,
statespace::StateSpace::State _state 
) const
pure virtual

Evaluates the state of the trajectory at time _t and store the result in a _state allocated by getStateSpace().

The output of this function is implementation-defined if _t is not between getStartTime() and getEndTime().

Parameters
_ttime parameter
[out]_stateoutput state of the trajectory at time _t

Implemented in aikido::trajectory::BSpline, aikido::trajectory::Spline, and aikido::trajectory::Interpolated.

◆ evaluateDerivative()

virtual void aikido::trajectory::Trajectory::evaluateDerivative ( double  _t,
int  _derivative,
Eigen::VectorXd &  _tangentVector 
) const
pure virtual

Evaluates the derivative of the trajectory at time _t.

The _tangentVector is defined in the local frame (i.e. "body frame") and is implementation-defined if not between getStartTime() and getEndTime(). Derivatives of order higher than getNumDerivatives are guaranteed to be zero.

Parameters
_ttime parameter
_derivativeorder of derivative
[out]_tangentVectoroutput tangent vector in the local frame

Implemented in aikido::trajectory::BSpline, aikido::trajectory::Spline, and aikido::trajectory::Interpolated.

◆ getDuration()

virtual double aikido::trajectory::Trajectory::getDuration ( ) const
pure virtual

Duration of the trajectory.

Note that getStartTime() may not be zero.

Returns
duration of the trajectory

Implemented in aikido::trajectory::BSpline, aikido::trajectory::Spline, and aikido::trajectory::Interpolated.

◆ getEndTime()

virtual double aikido::trajectory::Trajectory::getEndTime ( ) const
pure virtual

Time at which the trajectory ends.

This may not be getDuration() if getStartTime() is not zero.

Returns
time at which the trajectory ends

Implemented in aikido::trajectory::BSpline, aikido::trajectory::Spline, and aikido::trajectory::Interpolated.

◆ getNumDerivatives()

virtual std::size_t aikido::trajectory::Trajectory::getNumDerivatives ( ) const
pure virtual

Gets an upper bound on the number of non-zero derivatives available in this parameterization.

Note that evaluateDerivative may return zero before this value for some trajectories.

Returns
upper bound on the number of non-zero derivatives

Implemented in aikido::trajectory::BSpline, aikido::trajectory::Spline, and aikido::trajectory::Interpolated.

◆ getStartTime()

virtual double aikido::trajectory::Trajectory::getStartTime ( ) const
pure virtual

Time at which the trajectory starts.

This may not be zero.

Returns
time at which the trajectory starts

Implemented in aikido::trajectory::BSpline, aikido::trajectory::Spline, and aikido::trajectory::Interpolated.

◆ getStateSpace()

virtual statespace::ConstStateSpacePtr aikido::trajectory::Trajectory::getStateSpace ( ) const
pure virtual

Gets the StateSpace that this trajectory is defined in.

Returns
state space this trajectory is defined in.

Implemented in aikido::trajectory::BSpline, aikido::trajectory::Spline, and aikido::trajectory::Interpolated.

Member Data Documentation

◆ metadata

TrajectoryMetadata aikido::trajectory::Trajectory::metadata

Trajectory metadata.