Drake
Drake C++ Documentation
StackedTrajectory< T > Class Template Referencefinal

Detailed Description

template<typename T>
class drake::trajectories::StackedTrajectory< T >

A StackedTrajectory stacks the values from one or more underlying Trajectory objects into a single Trajectory, without changing the start_time() or end_time().

For sequencing trajectories in time instead, see CompositeTrajectory.

All of the underlying Trajectory objects must have the same start_time() and end_time().

When constructed with rowwise set to true, all of the underlying Trajectory objects must have the same number of cols() and the value() matrix will be the vstack of the the trajectories in the order they were added.

When constructed with rowwise set to false, all of the underlying Trajectory objects must have the same number of rows() and the value() matrix will be the hstack of the the trajectories in the order they were added.

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

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

Public Member Functions

 StackedTrajectory (bool rowwise=true)
 Creates an empty trajectory. More...
 
 ~StackedTrajectory () final
 
void Append (const Trajectory< T > &traj)
 Stacks another sub-Trajectory onto this. More...
 
std::unique_ptr< Trajectory< T > > Clone () const final
 
MatrixX< T > value (const T &t) const final
 Evaluates the trajectory at the given time t. More...
 
Eigen::Index rows () const final
 
Eigen::Index cols () const final
 
start_time () const final
 
end_time () const final
 
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 StackedTrajectory (const StackedTrajectory &)=default
 
StackedTrajectoryoperator= (const StackedTrajectory &)=default
 
 StackedTrajectory (StackedTrajectory &&)=default
 
StackedTrajectoryoperator= (StackedTrajectory &&)=default
 
- Public Member Functions inherited from Trajectory< T >
virtual ~Trajectory ()=default
 
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. More...
 
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. More...
 
bool has_derivative () const
 Returns true iff the Trajectory provides and implementation for EvalDerivative() and MakeDerivative(). More...
 
MatrixX< T > EvalDerivative (const T &t, int derivative_order=1) const
 Evaluates the derivative of this at the given time t. More...
 
std::unique_ptr< Trajectory< T > > MakeDerivative (int derivative_order=1) const
 Takes the derivative of this Trajectory. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Trajectory< T >
 Trajectory ()=default
 
 Trajectory (const Trajectory &)=default
 
Trajectoryoperator= (const Trajectory &)=default
 
 Trajectory (Trajectory &&)=default
 
Trajectoryoperator= (Trajectory &&)=default
 

Constructor & Destructor Documentation

◆ StackedTrajectory() [1/3]

StackedTrajectory ( const StackedTrajectory< T > &  )
default

◆ StackedTrajectory() [2/3]

StackedTrajectory ( StackedTrajectory< T > &&  )
default

◆ StackedTrajectory() [3/3]

StackedTrajectory ( bool  rowwise = true)
explicit

Creates an empty trajectory.

Parameters
rowwisegoverns the stacking order

◆ ~StackedTrajectory()

~StackedTrajectory ( )
final

Member Function Documentation

◆ Append()

void Append ( const Trajectory< T > &  traj)

Stacks another sub-Trajectory onto this.

Refer to the class overview documentation for details.

Exceptions
std::exceptionif the matrix dimension is incompatible.

◆ Clone()

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

Implements Trajectory< T >.

◆ cols()

Eigen::Index cols ( ) const
finalvirtual
Returns
The number of columns in the matrix returned by value().

Implements Trajectory< T >.

◆ end_time()

T end_time ( ) const
finalvirtual

Implements Trajectory< T >.

◆ operator=() [1/2]

StackedTrajectory& operator= ( StackedTrajectory< T > &&  )
default

◆ operator=() [2/2]

StackedTrajectory& operator= ( const StackedTrajectory< T > &  )
default

◆ rows()

Eigen::Index rows ( ) const
finalvirtual
Returns
The number of rows in the matrix returned by value().

Implements Trajectory< T >.

◆ start_time()

T start_time ( ) const
finalvirtual

Implements Trajectory< T >.

◆ value()

MatrixX<T> value ( const T &  t) const
finalvirtual

Evaluates the trajectory at the given time t.

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

Implements Trajectory< T >.


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