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.
T | The 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 |
T | start_time () const final |
T | end_time () const final |
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable | |
StackedTrajectory (const StackedTrajectory &)=default | |
StackedTrajectory & | operator= (const StackedTrajectory &)=default |
StackedTrajectory (StackedTrajectory &&)=default | |
StackedTrajectory & | operator= (StackedTrajectory &&)=default |
Public Member Functions inherited from Trajectory< T > | |
virtual | ~Trajectory () |
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 | |
Trajectory & | operator= (const Trajectory &)=default |
Trajectory (Trajectory &&)=default | |
Trajectory & | operator= (Trajectory &&)=default |
|
default |
|
default |
|
explicit |
Creates an empty trajectory.
rowwise | governs the stacking order |
|
final |
void Append | ( | const Trajectory< T > & | traj | ) |
Stacks another sub-Trajectory onto this.
Refer to the class overview documentation for details.
std::exception | if the matrix dimension is incompatible. |
|
finalvirtual |
Implements Trajectory< T >.
|
finalvirtual |
Implements Trajectory< T >.
|
finalvirtual |
Implements Trajectory< T >.
|
default |
|
default |
|
finalvirtual |
Implements Trajectory< T >.
|
finalvirtual |
Implements Trajectory< T >.
|
finalvirtual |
Evaluates the trajectory at the given time t
.
t | The time at which to evaluate the trajectory. |
Implements Trajectory< T >.