Drake
Drake C++ Documentation
Loading...
Searching...
No Matches
Trajectory< T > Class Template Referenceabstract

Detailed Description

template<typename T>
class drake::multibody::Trajectory< T >

A Trajectory represents a time-varying matrix, indexed by a single scalar time.

Template Parameters
TThe scalar type, which must be one of the default scalars.

#include <drake/common/trajectories/trajectory.h>

Public Member Functions

virtual ~Trajectory ()
std::unique_ptr< Trajectory< T > > Clone () const
MatrixX< T > value (const T &t) const
 Evaluates the trajectory at the given time t.
MatrixX< T > vector_values (const std::vector< T > &t) const
 If cols()==1, then evaluates the trajectory at each time t, and returns the results as a Matrix with the ith column corresponding to the ith time.
MatrixX< T > vector_values (const Eigen::Ref< const VectorX< T > > &t) const
 If cols()==1, then evaluates the trajectory at each time t, and returns the results as a Matrix with the ith column corresponding to the ith time.
bool has_derivative () const
 Returns true iff the Trajectory provides and implementation for EvalDerivative() and MakeDerivative().
MatrixX< T > EvalDerivative (const T &t, int derivative_order=1) const
 Evaluates the derivative of this at the given time t.
std::unique_ptr< Trajectory< T > > MakeDerivative (int derivative_order=1) const
 Takes the derivative of this Trajectory.
Eigen::Index rows () const
Eigen::Index cols () const
start_time () const
end_time () const

Protected Member Functions

 Trajectory ()=default
virtual std::unique_ptr< Trajectory< T > > DoClone () const=0
virtual MatrixX< T > do_value (const T &t) const=0
virtual bool do_has_derivative () const
virtual MatrixX< T > DoEvalDerivative (const T &t, int derivative_order) const
virtual std::unique_ptr< Trajectory< T > > DoMakeDerivative (int derivative_order) const
virtual Eigen::Index do_rows () const=0
virtual Eigen::Index do_cols () const=0
virtual T do_start_time () const=0
virtual T do_end_time () const=0
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 Trajectory (const Trajectory &)=default
 Trajectory (Trajectory &&)=default
Trajectoryoperator= (const Trajectory &)=default
Trajectoryoperator= (Trajectory &&)=default

Constructor & Destructor Documentation

◆ ~Trajectory()

template<typename T>
virtual ~Trajectory ( )
virtual

◆ Trajectory() [1/3]

template<typename T>
Trajectory ( const Trajectory< T > & )
protecteddefault

◆ Trajectory() [2/3]

template<typename T>
Trajectory ( Trajectory< T > && )
protecteddefault

◆ Trajectory() [3/3]

template<typename T>
Trajectory ( )
protecteddefault

Member Function Documentation

◆ Clone()

template<typename T>
std::unique_ptr< Trajectory< T > > Clone ( ) const
Returns
A deep copy of this Trajectory.

◆ cols()

template<typename T>
Eigen::Index cols ( ) const
Returns
The number of columns in the matrix returned by value().

◆ do_cols()

template<typename T>
virtual Eigen::Index do_cols ( ) const
protectedpure virtual

◆ do_end_time()

template<typename T>
virtual T do_end_time ( ) const
protectedpure virtual

◆ do_has_derivative()

template<typename T>
virtual bool do_has_derivative ( ) const
protectedvirtual

◆ do_rows()

template<typename T>
virtual Eigen::Index do_rows ( ) const
protectedpure virtual

◆ do_start_time()

template<typename T>
virtual T do_start_time ( ) const
protectedpure virtual

◆ do_value()

template<typename T>
virtual MatrixX< T > do_value ( const T & t) const
protectedpure virtual

◆ DoClone()

template<typename T>
virtual std::unique_ptr< Trajectory< T > > DoClone ( ) const
protectedpure virtual

◆ DoEvalDerivative()

template<typename T>
virtual MatrixX< T > DoEvalDerivative ( const T & t,
int derivative_order ) const
protectedvirtual

◆ DoMakeDerivative()

template<typename T>
virtual std::unique_ptr< Trajectory< T > > DoMakeDerivative ( int derivative_order) const
protectedvirtual

◆ end_time()

template<typename T>
T end_time ( ) const

◆ EvalDerivative()

template<typename T>
MatrixX< T > EvalDerivative ( const T & t,
int derivative_order = 1 ) const

Evaluates the derivative of this at the given time t.

Returns the nth derivative, where n is the value of derivative_order.

Exceptions
std::exceptionif derivative_order is negative.

◆ has_derivative()

template<typename T>
bool has_derivative ( ) const

Returns true iff the Trajectory provides and implementation for EvalDerivative() and MakeDerivative().

The derivative need not be continuous, but should return a result for all t for which value(t) returns a result.

◆ MakeDerivative()

template<typename T>
std::unique_ptr< Trajectory< T > > MakeDerivative ( int derivative_order = 1) const

Takes the derivative of this Trajectory.

Parameters
derivative_orderThe number of times to take the derivative before returning.
Returns
The nth derivative of this object.
Exceptions
std::exceptionif derivative_order is negative.

◆ operator=() [1/2]

template<typename T>
Trajectory & operator= ( const Trajectory< T > & )
protecteddefault

◆ operator=() [2/2]

template<typename T>
Trajectory & operator= ( Trajectory< T > && )
protecteddefault

◆ rows()

template<typename T>
Eigen::Index rows ( ) const
Returns
The number of rows in the matrix returned by value().

◆ start_time()

template<typename T>
T start_time ( ) const

◆ value()

template<typename T>
MatrixX< T > value ( const T & t) const

Evaluates the trajectory at the given time t.

Parameters
tThe time at which to evaluate the trajectory.
Returns
The matrix of evaluated values.

◆ vector_values() [1/2]

template<typename T>
MatrixX< T > vector_values ( const Eigen::Ref< const VectorX< T > > & t) const

If cols()==1, then evaluates the trajectory at each time t, and returns the results as a Matrix with the ith column corresponding to the ith time.

Otherwise, if rows()==1, then evaluates the trajectory at each time t, and returns the results as a Matrix with the ith row corresponding to the ith time.

Exceptions
std::exceptionif both cols and rows are not equal to 1.

◆ vector_values() [2/2]

template<typename T>
MatrixX< T > vector_values ( const std::vector< T > & t) const

If cols()==1, then evaluates the trajectory at each time t, and returns the results as a Matrix with the ith column corresponding to the ith time.

Otherwise, if rows()==1, then evaluates the trajectory at each time t, and returns the results as a Matrix with the ith row corresponding to the ith time.

Exceptions
std::exceptionif both cols and rows are not equal to 1.

The documentation for this class was generated from the following file: