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. More... | |
PiecewisePose (const PiecewisePolynomial< T > &position_trajectory, const PiecewiseQuaternionSlerp< T > &orientation_trajectory) | |
Constructor. More... | |
~PiecewisePose () override | |
std::unique_ptr< Trajectory< T > > | Clone () const override |
Eigen::Index | rows () const override |
Eigen::Index | cols () const override |
math::RigidTransform< T > | GetPose (const T &time) const |
Returns the interpolated pose at time . More... | |
MatrixX< T > | value (const T &t) const override |
Evaluates the trajectory at the given time t . More... | |
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. More... | |
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. More... | |
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. More... | |
const PiecewisePolynomial< T > & | get_position_trajectory () const |
Returns the position trajectory. More... | |
const PiecewiseQuaternionSlerp< T > & | get_orientation_trajectory () const |
Returns the orientation trajectory. More... | |
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 |
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 PiecewisePose< T > | MakeLinear (const std::vector< T > ×, const std::vector< math::RigidTransform< T >> &poses) |
Constructs a PiecewisePose from given times and poses . More... | |
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 . 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 |
PiecewisePose | ( | ) |
Constructs an empty piecewise pose trajectory.
PiecewisePose | ( | const PiecewisePolynomial< T > & | position_trajectory, |
const PiecewiseQuaternionSlerp< T > & | orientation_trajectory | ||
) |
Constructor.
pos_traj | Position trajectory. |
rot_traj | Orientation trajectory. |
|
override |
|
overridevirtual |
Implements Trajectory< T >.
|
overridevirtual |
Implements Trajectory< T >.
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 |
|
overridevirtual |
Implements Trajectory< T >.
|
overridevirtual |
Evaluates the trajectory at the given time t
.
t | The time at which to evaluate the trajectory. |
Implements Trajectory< T >.