mc_trajectory::BSpline Struct Reference

#include <mc_trajectory/BSpline.h>

Inheritance diagram for mc_trajectory::BSpline:
Collaboration diagram for mc_trajectory::BSpline:

Public Types

using bezier_curve_t = ndcurves::bezier_curve< double, double, false, Eigen::Vector3d >
 
using waypoints_t = std::vector< Eigen::Vector3d >
 

Public Member Functions

 BSpline (double duration, const Eigen::Vector3d &start, const Eigen::Vector3d &target, const waypoints_t &waypoints={})
 Creates a curve with given waypoints (should includes starting and target position) 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...
 
std::vector< Eigen::Vector3d > splev (double t, unsigned int der=0)
 Computes the position along the curve at time t, and its derivatives up to the nth order (typically velocity, acceleration) More...
 
std::vector< Eigen::Vector3d > sampleTrajectory ()
 Sample positions along the trajectory (for visualization purposes) More...
 
void addToGUI (mc_rtc::gui::StateBuilder &gui, const std::vector< std::string > &category)
 Add GUI elements to control the curve's waypoints and targets. More...
 
- Public Member Functions inherited from mc_trajectory::Spline< Eigen::Vector3d, std::vector< Eigen::Vector3d > >
 Spline (double duration, const Eigen::Vector3d &start, const Eigen::Vector3d &target, const std::vector< Eigen::Vector3d > &waypoints={})
 
void waypoints (const std::vector< Eigen::Vector3d > &waypoints)
 Defines waypoints. More...
 
const std::vector< Eigen::Vector3d > & waypoints () const
 Returns waypoints. More...
 
void start (const Eigen::Vector3d &start)
 Starting point for the trajectory at time t=0. More...
 
const Eigen::Vector3d & start () const
 Starting point at time t=0. More...
 
void target (const Eigen::Vector3d &target)
 Sets the spline target. More...
 
const Eigen::Vector3d & 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...
 

Additional Inherited Members

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

Member Typedef Documentation

◆ bezier_curve_t

using mc_trajectory::BSpline::bezier_curve_t = ndcurves::bezier_curve<double, double, false, Eigen::Vector3d>

◆ waypoints_t

using mc_trajectory::BSpline::waypoints_t = std::vector<Eigen::Vector3d>

Constructor & Destructor Documentation

◆ BSpline()

mc_trajectory::BSpline::BSpline ( double  duration,
const Eigen::Vector3d &  start,
const Eigen::Vector3d &  target,
const waypoints_t waypoints = {} 
)

Creates a curve with given waypoints (should includes starting and target position)

Parameters
durationduration of the curve
startstarting position at time t=0
targettarget position at time t=duration
waypointscontrol points for the bezier curve (excluding start and target points)

Member Function Documentation

◆ addToGUI()

void mc_trajectory::BSpline::addToGUI ( mc_rtc::gui::StateBuilder gui,
const std::vector< std::string > &  category 
)

Add GUI elements to control the curve's waypoints and targets.

Parameters
guiGUI to which the task should be added
categorycategory in the GUI to which the curve's control belong to

◆ sampleTrajectory()

std::vector<Eigen::Vector3d> mc_trajectory::BSpline::sampleTrajectory ( )

Sample positions along the trajectory (for visualization purposes)

Parameters
samplesnumber of samples along the curve to compute [minimum = 1]
Returns
Evenly sampled positions along the trajectory.

◆ splev()

std::vector<Eigen::Vector3d> mc_trajectory::BSpline::splev ( double  t,
unsigned int  der = 0 
)

Computes the position along the curve at time t, and its derivatives up to the nth order (typically velocity, acceleration)

Parameters
ttime at which the curve should be evaluated
derderivation order
Returns
The position and its derivatives along the curve at time t.

◆ update()

void mc_trajectory::BSpline::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::Vector3d, std::vector< Eigen::Vector3d > >.


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