A "composite trajectory" is a series of trajectories joined end to end where the end time of one trajectory coincides with the starting time of the next.
See also PiecewisePolynomial::ConcatenateInTime(), which might be preferred if all of the segments are PiecewisePolynomial.
T | The scalar type, which must be one of the default scalars. |
#include <drake/common/trajectories/composite_trajectory.h>
Public Member Functions | |
CompositeTrajectory (std::vector< copyable_unique_ptr< Trajectory< T >>> segments) | |
Constructs a composite trajectory from a list of Trajectories. More... | |
~CompositeTrajectory () final | |
std::unique_ptr< trajectories::Trajectory< T > > | Clone () const final |
MatrixX< T > | value (const T &time) const final |
Evaluates the curve at the given time. More... | |
Eigen::Index | rows () const final |
Eigen::Index | cols () const final |
const Trajectory< T > & | segment (int segment_index) const |
Returns a reference to the segment_index trajectory. More... | |
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable | |
CompositeTrajectory (const CompositeTrajectory &)=default | |
CompositeTrajectory & | operator= (const CompositeTrajectory &)=default |
CompositeTrajectory (CompositeTrajectory &&)=default | |
CompositeTrajectory & | operator= (CompositeTrajectory &&)=default |
Public Member Functions inherited from PiecewiseTrajectory< T > | |
~PiecewiseTrajectory () override | |
int | get_number_of_segments () const |
T | start_time (int segment_number) const |
T | end_time (int segment_number) const |
T | duration (int segment_number) const |
T | start_time () const override |
T | end_time () const override |
boolean< T > | is_time_in_range (const T &t) const |
Returns true iff t >= getStartTime() && t <= getEndTime() . More... | |
int | get_segment_index (const T &t) const |
const std::vector< T > & | get_segment_times () const |
void | segment_number_range_check (int segment_number) const |
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... | |
Static Public Member Functions | |
static CompositeTrajectory< T > | AlignAndConcatenate (const std::vector< copyable_unique_ptr< Trajectory< T >>> &segments) |
Constructs a composite trajectory from a list of trajectories whose start and end times may not coincide, by translating their start and end times. More... | |
Static Public Member Functions inherited from PiecewiseTrajectory< T > | |
static std::vector< T > | RandomSegmentTimes (int num_segments, std::default_random_engine &generator) |
Additional Inherited Members | |
Static Public Attributes inherited from PiecewiseTrajectory< T > | |
static constexpr double | kEpsilonTime = std::numeric_limits<double>::epsilon() |
Minimum delta quantity used for comparing time. More... | |
Protected Member Functions inherited from PiecewiseTrajectory< T > | |
PiecewiseTrajectory ()=default | |
PiecewiseTrajectory (const std::vector< T > &breaks) | |
breaks increments must be greater or equal to kEpsilonTime. More... | |
bool | SegmentTimesEqual (const PiecewiseTrajectory &b, double tol=kEpsilonTime) const |
const std::vector< T > & | breaks () const |
std::vector< T > & | get_mutable_breaks () |
PiecewiseTrajectory (const PiecewiseTrajectory &)=default | |
PiecewiseTrajectory & | operator= (const PiecewiseTrajectory &)=default |
PiecewiseTrajectory (PiecewiseTrajectory &&)=default | |
PiecewiseTrajectory & | operator= (PiecewiseTrajectory &&)=default |
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 |
Constructs a composite trajectory from a list of Trajectories.
segments[i].get() != nullptr
. segments[i+1].start_time() == segments[i].end_time()
. segments[i].rows() == segments[0].rows()
and segments[i].cols() == segments[0].cols()`.
|
final |
|
static |
|
finalvirtual |
Implements Trajectory< T >.
|
finalvirtual |
Implements Trajectory< T >.
|
default |
|
default |
|
finalvirtual |
Implements Trajectory< T >.
const Trajectory<T>& segment | ( | int | segment_index | ) | const |
Returns a reference to the segment_index
trajectory.
|
finalvirtual |
Evaluates the curve at the given time.
time
. For example, value(-1)
will return value(0)
for a trajectory defined over [0, 1]. Implements Trajectory< T >.