A wrapper class that represents a pose trajectory, whose rotation part is a PiecewiseQuaternionSlerp and the translation part is a PiecewisePolynomial.
| T | The scalar type, which must be one of the default scalars. |
#include <drake/common/trajectories/piecewise_pose.h>
Public Member Functions | |
| PiecewisePose () | |
| Constructs an empty piecewise pose trajectory. | |
| PiecewisePose (const PiecewisePolynomial< T > &position_trajectory, const PiecewiseQuaternionSlerp< T > &orientation_trajectory) | |
| Constructor. | |
| ~PiecewisePose () final | |
| math::RigidTransform< T > | GetPose (const T &time) const |
Returns the interpolated pose at time. | |
| Vector6< T > | GetVelocity (const T &time) const |
Returns the interpolated velocity at time or zero if time is before this trajectory's start time or after its end time. | |
| Vector6< T > | GetAcceleration (const T &time) const |
Returns the interpolated acceleration at time or zero if time is before this trajectory's start time or after its end time. | |
| bool | IsApprox (const PiecewisePose< T > &other, double tol) const |
Returns true if the position and orientation trajectories are both within tol from the other's. | |
| const PiecewisePolynomial< T > & | get_position_trajectory () const |
| Returns the position trajectory. | |
| const PiecewiseQuaternionSlerp< T > & | get_orientation_trajectory () const |
| Returns the orientation trajectory. | |
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable | |
| PiecewisePose (const PiecewisePose &)=default | |
| PiecewisePose & | operator= (const PiecewisePose &)=default |
| PiecewisePose (PiecewisePose &&)=default | |
| PiecewisePose & | operator= (PiecewisePose &&)=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 |
| boolean< T > | is_time_in_range (const T &t) const |
| Returns true iff t >= getStartTime() && t <= getEndTime(). | |
| 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. | |
| 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 |
| T | start_time () const |
| T | end_time () const |
Static Public Member Functions | |
| static PiecewisePose< T > | MakeLinear (const std::vector< T > ×, const std::vector< math::RigidTransform< T > > &poses) |
Constructs a PiecewisePose from given times and poses. | |
| static PiecewisePose< T > | MakeCubicLinearWithEndLinearVelocity (const std::vector< T > ×, const std::vector< math::RigidTransform< T > > &poses, const Vector3< T > &start_vel=Vector3< T >::Zero(), const Vector3< T > &end_vel=Vector3< T >::Zero()) |
Constructs a PiecewisePose from given times and poses. | |
| 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. | |
| Protected Member Functions inherited from PiecewiseTrajectory< T > | |
| PiecewiseTrajectory ()=default | |
| PiecewiseTrajectory (const std::vector< T > &breaks) | |
breaks increments must be greater or equal to kEpsilonTime. | |
| 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 () |
| 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 |
| PiecewisePose | ( | ) |
Constructs an empty piecewise pose trajectory.
| PiecewisePose | ( | const PiecewisePolynomial< T > & | position_trajectory, |
| const PiecewiseQuaternionSlerp< T > & | orientation_trajectory ) |
Constructor.
| position_trajectory | Position trajectory. |
| orientation_trajectory | Orientation trajectory. |
|
final |
| const PiecewiseQuaternionSlerp< T > & get_orientation_trajectory | ( | ) | const |
Returns the orientation trajectory.
| const PiecewisePolynomial< T > & get_position_trajectory | ( | ) | const |
Returns the position trajectory.
| Vector6< T > GetAcceleration | ( | const T & | time | ) | const |
Returns the interpolated acceleration at time or zero if time is before this trajectory's start time or after its end time.
| math::RigidTransform< T > GetPose | ( | const T & | time | ) | const |
Returns the interpolated pose at time.
| Vector6< T > GetVelocity | ( | const T & | time | ) | const |
Returns the interpolated velocity at time or zero if time is before this trajectory's start time or after its end time.
| bool IsApprox | ( | const PiecewisePose< T > & | other, |
| double | tol ) const |
Returns true if the position and orientation trajectories are both within tol from the other's.
|
static |
Constructs a PiecewisePose from given times and poses.
A cubic polynomial with given end velocities is used to construct the position part. The rotational part is represented by a piecewise quaterion trajectory. There must be at least two elements in times and poses.
| times | Breaks used to build the splines. |
| poses | Knots used to build the splines. |
| start_vel | Start linear velocity. |
| end_vel | End linear velocity. |
|
static |
Constructs a PiecewisePose from given times and poses.
The positions trajectory is constructed as a first-order hold. The orientation is constructed using the quaternion slerp. There must be at least two elements in times and poses.
| times | Breaks used to build the splines. |
| poses | Knots used to build the splines. |
|
default |
|
default |