mc_trajectory::InterpolatedRotation Struct Reference

Describes a trajectory with smoothly interpolate rotation between waypoints. More...

#include <mc_trajectory/InterpolatedRotation.h>

Inheritance diagram for mc_trajectory::InterpolatedRotation:
Collaboration diagram for mc_trajectory::InterpolatedRotation:

Public Types

using waypoint_t = std::pair< double, Eigen::Matrix3d >
 

Public Member Functions

 InterpolatedRotation (double duration, const Eigen::Matrix3d &start, const Eigen::Matrix3d &target, const std::vector< waypoint_t > &waypoints={})
 Creates a trajectory that smoothly interpolates rotation in-between waypoints. More...
 
void update () override
 Triggers recreation of the curve. Will only occur if the curve parameters were modified (waypoints, target), or the sampling size has changed. More...
 
Eigen::Matrix3d eval (double t)
 Evaluate the orientation at time t. More...
 
void waypoint (size_t idx, const Eigen::Matrix3d &ori)
 Modifies an existing waypoint. More...
 
const waypoint_twaypoint (size_t idx) const
 Gets an existing waypoint. More...
 
- Public Member Functions inherited from mc_trajectory::Spline< Eigen::Matrix3d, std::vector< std::pair< double, Eigen::Matrix3d > > >
 Spline (double duration, const Eigen::Matrix3d &start, const Eigen::Matrix3d &target, const std::vector< std::pair< double, Eigen::Matrix3d > > &waypoints={})
 
void waypoints (const std::vector< std::pair< double, Eigen::Matrix3d > > &waypoints)
 Defines waypoints. More...
 
const std::vector< std::pair< double, Eigen::Matrix3d > > & waypoints () const
 Returns waypoints. More...
 
void start (const Eigen::Matrix3d &start)
 Starting point for the trajectory at time t=0. More...
 
const Eigen::Matrix3d & start () const
 Starting point at time t=0. More...
 
void target (const Eigen::Matrix3d &target)
 Sets the spline target. More...
 
const Eigen::Matrix3d & target () const
 Gets the spline target position. More...
 
void samplingPoints (unsigned s)
 Number of sampling points for the trajectory visualization. More...
 
unsigned samplingPoints () const
 Gets number of samples. More...
 

Protected Attributes

std::vector< waypoint_tall_waypoints_
 
- Protected Attributes inherited from mc_trajectory::Spline< Eigen::Matrix3d, std::vector< std::pair< double, Eigen::Matrix3d > > >
double duration_
 
Eigen::Matrix3d start_
 
Eigen::Matrix3d target_
 
std::vector< std::pair< double, Eigen::Matrix3d > > waypoints_
 
unsigned samplingPoints_
 
std::vector< Eigen::Matrix3d > samples_
 
bool needsUpdate_
 

Detailed Description

Describes a trajectory with smoothly interpolate rotation between waypoints.

Member Typedef Documentation

◆ waypoint_t

using mc_trajectory::InterpolatedRotation::waypoint_t = std::pair<double, Eigen::Matrix3d>

Constructor & Destructor Documentation

◆ InterpolatedRotation()

mc_trajectory::InterpolatedRotation::InterpolatedRotation ( double  duration,
const Eigen::Matrix3d &  start,
const Eigen::Matrix3d &  target,
const std::vector< waypoint_t > &  waypoints = {} 
)

Creates a trajectory that smoothly interpolates rotation in-between waypoints.

Parameters
durationDuration of the curve
startStarting orientation at t=0
targetFinal orientation at t=duration
waypointsOptional waypoints as pairs of [time, orientation]. Time should be 0<time<duration.

Member Function Documentation

◆ eval()

Eigen::Matrix3d mc_trajectory::InterpolatedRotation::eval ( double  t)

Evaluate the orientation at time t.

Parameters
tTime at which the curve should be evaluated
Returns
Interpolated orientation at time t

◆ update()

void mc_trajectory::InterpolatedRotation::update ( )
overridevirtual

Triggers recreation of the curve. Will only occur if the curve parameters were modified (waypoints, target), or the sampling size has changed.

Implements mc_trajectory::Spline< Eigen::Matrix3d, std::vector< std::pair< double, Eigen::Matrix3d > > >.

◆ waypoint() [1/2]

const waypoint_t& mc_trajectory::InterpolatedRotation::waypoint ( size_t  idx) const

Gets an existing waypoint.

Parameters
idxId of the waypoint
Returns
Waypoint with index idx

◆ waypoint() [2/2]

void mc_trajectory::InterpolatedRotation::waypoint ( size_t  idx,
const Eigen::Matrix3d &  ori 
)

Modifies an existing waypoint.

Parameters
idxId of the waypoint
oriDesired orientation for that waypoint

Member Data Documentation

◆ all_waypoints_

std::vector<waypoint_t> mc_trajectory::InterpolatedRotation::all_waypoints_
protected

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