Abstract class that implements the basic logic of maintaining consequent segments of time (delimited by breaks) to implement a trajectory that is represented by simpler logic in each segment or "piece".
| T | The scalar type, which must be one of the default scalars. |
#include <drake/common/trajectories/piecewise_trajectory.h>
Public Member Functions | |
| ~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 |
| 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 () |
| std::unique_ptr< Trajectory< T > > | Clone () const |
| MatrixX< T > | value (const T &t) const |
Evaluates the trajectory at the given time t. More... | |
| 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... | |
| Eigen::Index | rows () const |
| Eigen::Index | cols () const |
| T | start_time () const |
| T | end_time () const |
Static Public Member Functions | |
| static std::vector< T > | RandomSegmentTimes (int num_segments, std::default_random_engine &generator) |
Static Public Attributes | |
| static constexpr double | kEpsilonTime = std::numeric_limits<double>::epsilon() |
| Minimum delta quantity used for comparing time. More... | |
Protected Member Functions | |
| PiecewiseTrajectory ()=default | |
| PiecewiseTrajectory (const std::vector< T > &breaks) | |
breaks increments must be greater or equal to kEpsilonTime. More... | |
| T | do_start_time () const override |
| T | do_end_time () const override |
| bool | SegmentTimesEqual (const PiecewiseTrajectory &b, double tol=kEpsilonTime) const |
| const std::vector< T > & | breaks () const |
| std::vector< T > & | get_mutable_breaks () |
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable | |
| 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 | |
| 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 |
| Trajectory (const Trajectory &)=default | |
| Trajectory & | operator= (const Trajectory &)=default |
| Trajectory (Trajectory &&)=default | |
| Trajectory & | operator= (Trajectory &&)=default |
|
override |
|
protecteddefault |
|
protecteddefault |
|
protecteddefault |
|
explicitprotected |
breaks increments must be greater or equal to kEpsilonTime.
|
protected |
|
overrideprotectedvirtual |
Implements Trajectory< T >.
|
overrideprotectedvirtual |
Implements Trajectory< T >.
| T duration | ( | int | segment_number | ) | const |
| T end_time | ( | int | segment_number | ) | const |
|
protected |
| int get_number_of_segments | ( | ) | const |
| int get_segment_index | ( | const T & | t | ) | const |
| const std::vector<T>& get_segment_times | ( | ) | const |
| boolean<T> is_time_in_range | ( | const T & | t | ) | const |
Returns true iff t >= getStartTime() && t <= getEndTime().
|
protecteddefault |
|
protecteddefault |
|
static |
| void segment_number_range_check | ( | int | segment_number | ) | const |
|
protected |
| T start_time | ( | int | segment_number | ) | const |
Minimum delta quantity used for comparing time.