Drake
Drake C++ Documentation
PiecewisePose< T > Class Template Referencefinal

Detailed Description

template<typename T>
class drake::trajectories::PiecewisePose< T >

A wrapper class that represents a pose trajectory, whose rotation part is a PiecewiseQuaternionSlerp and the translation part is a PiecewisePolynomial.

Template Parameters
TThe 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...
 
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
 
PiecewisePoseoperator= (const PiecewisePose &)=default
 
 PiecewisePose (PiecewisePose &&)=default
 
PiecewisePoseoperator= (PiecewisePose &&)=default
 
- Public Member Functions inherited from PiecewiseTrajectory< T >
 ~PiecewiseTrajectory () override=default
 
int get_number_of_segments () const
 
start_time (int segment_number) const
 
end_time (int segment_number) const
 
duration (int segment_number) const
 
start_time () const override
 
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 ()=default
 
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 > &times, const std::vector< math::RigidTransform< T >> &poses)
 Constructs a PiecewisePose from given times and poses. More...
 
static PiecewisePose< T > MakeCubicLinearWithEndLinearVelocity (const std::vector< T > &times, 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
 
PiecewiseTrajectoryoperator= (const PiecewiseTrajectory &)=default
 
 PiecewiseTrajectory (PiecewiseTrajectory &&)=default
 
PiecewiseTrajectoryoperator= (PiecewiseTrajectory &&)=default
 
- Protected Member Functions inherited from Trajectory< T >
 Trajectory ()=default
 
 Trajectory (const Trajectory &)=default
 
Trajectoryoperator= (const Trajectory &)=default
 
 Trajectory (Trajectory &&)=default
 
Trajectoryoperator= (Trajectory &&)=default
 

Constructor & Destructor Documentation

◆ PiecewisePose() [1/4]

PiecewisePose ( const PiecewisePose< T > &  )
default

◆ PiecewisePose() [2/4]

PiecewisePose ( PiecewisePose< T > &&  )
default

◆ PiecewisePose() [3/4]

Constructs an empty piecewise pose trajectory.

◆ PiecewisePose() [4/4]

PiecewisePose ( const PiecewisePolynomial< T > &  position_trajectory,
const PiecewiseQuaternionSlerp< T > &  orientation_trajectory 
)

Constructor.

Parameters
pos_trajPosition trajectory.
rot_trajOrientation trajectory.

Member Function Documentation

◆ Clone()

std::unique_ptr<Trajectory<T> > Clone ( ) const
overridevirtual
Returns
A deep copy of this Trajectory.

Implements Trajectory< T >.

◆ cols()

Eigen::Index cols ( ) const
overridevirtual
Returns
The number of columns in the matrix returned by value().

Implements Trajectory< T >.

◆ get_orientation_trajectory()

const PiecewiseQuaternionSlerp<T>& get_orientation_trajectory ( ) const

Returns the orientation trajectory.

◆ get_position_trajectory()

const PiecewisePolynomial<T>& get_position_trajectory ( ) const

Returns the position trajectory.

◆ GetAcceleration()

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.

◆ GetPose()

math::RigidTransform<T> GetPose ( const T &  time) const

Returns the interpolated pose at time.

◆ GetVelocity()

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.

◆ IsApprox()

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.

◆ MakeCubicLinearWithEndLinearVelocity()

static PiecewisePose<T> MakeCubicLinearWithEndLinearVelocity ( const std::vector< T > &  times,
const std::vector< math::RigidTransform< T >> &  poses,
const Vector3< T > &  start_vel = Vector3< T >::Zero(),
const Vector3< T > &  end_vel = Vector3< T >::Zero() 
)
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.

Parameters
timesBreaks used to build the splines.
posesKnots used to build the splines.
start_velStart linear velocity.
end_velEnd linear velocity.

◆ MakeLinear()

static PiecewisePose<T> MakeLinear ( const std::vector< T > &  times,
const std::vector< math::RigidTransform< T >> &  poses 
)
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.

Parameters
timesBreaks used to build the splines.
posesKnots used to build the splines.

◆ operator=() [1/2]

PiecewisePose& operator= ( PiecewisePose< T > &&  )
default

◆ operator=() [2/2]

PiecewisePose& operator= ( const PiecewisePose< T > &  )
default

◆ rows()

Eigen::Index rows ( ) const
overridevirtual
Returns
The number of rows in the matrix returned by value().

Implements Trajectory< T >.

◆ value()

MatrixX<T> value ( const T &  t) const
overridevirtual

Evaluates the trajectory at the given time t.

Parameters
tThe time at which to evaluate the trajectory.
Returns
The matrix of evaluated values.

Implements Trajectory< T >.


The documentation for this class was generated from the following file: