mc_trajectory::Spline< T, WaypointsT > Struct Template Referenceabstract

#include <mc_trajectory/Spline.h>

Public Member Functions

 Spline (double duration, const T &start, const T &target, const WaypointsT &waypoints={})
 
void waypoints (const WaypointsT &waypoints)
 Defines waypoints. More...
 
const WaypointsT & waypoints () const
 Returns waypoints. More...
 
void start (const T &start)
 Starting point for the trajectory at time t=0. More...
 
const T & start () const
 Starting point at time t=0. More...
 
void target (const T &target)
 Sets the spline target. More...
 
const T & 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...
 
virtual void update ()=0
 Triggers recreation of the curve. Will only occur if the curve parameters were modified (waypoints, target), or the sampling size has changed. More...
 

Protected Attributes

double duration_
 
start_
 
target_
 
WaypointsT waypoints_
 
unsigned samplingPoints_ = 10
 
std::vector< T > samples_
 
bool needsUpdate_ = false
 

Constructor & Destructor Documentation

◆ Spline()

template<typename T , typename WaypointsT >
mc_trajectory::Spline< T, WaypointsT >::Spline ( double  duration,
const T &  start,
const T &  target,
const WaypointsT &  waypoints = {} 
)

Member Function Documentation

◆ samplingPoints() [1/2]

template<typename T , typename WaypointsT >
unsigned mc_trajectory::Spline< T, WaypointsT >::samplingPoints ( ) const

Gets number of samples.

Returns
number of samples

◆ samplingPoints() [2/2]

template<typename T , typename WaypointsT >
void mc_trajectory::Spline< T, WaypointsT >::samplingPoints ( unsigned  s)

Number of sampling points for the trajectory visualization.

Parameters
sNumber of sampling points. If the number of samples is different from the one previously specified, this will trigger a curve recomputation.

◆ start() [1/2]

template<typename T , typename WaypointsT >
const T& mc_trajectory::Spline< T, WaypointsT >::start ( ) const

Starting point at time t=0.

Returns
starting point

◆ start() [2/2]

template<typename T , typename WaypointsT >
void mc_trajectory::Spline< T, WaypointsT >::start ( const T &  start)

Starting point for the trajectory at time t=0.

Parameters
posstarting point

◆ target() [1/2]

template<typename T , typename WaypointsT >
const T& mc_trajectory::Spline< T, WaypointsT >::target ( ) const

Gets the spline target position.

Returns
The spline target position

◆ target() [2/2]

template<typename T , typename WaypointsT >
void mc_trajectory::Spline< T, WaypointsT >::target ( const T &  target)

Sets the spline target.

Parameters
targetfinal target for the spline

◆ update()

template<typename T , typename WaypointsT >
virtual void mc_trajectory::Spline< T, WaypointsT >::update ( )
pure virtual

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

Implemented in mc_trajectory::ExactCubic, mc_trajectory::BSpline, and mc_trajectory::InterpolatedRotation.

◆ waypoints() [1/2]

template<typename T , typename WaypointsT >
const WaypointsT& mc_trajectory::Spline< T, WaypointsT >::waypoints ( ) const

Returns waypoints.

Returns
Waypoints. Doesn't include starting and target orienation (use start() and target() instead).

◆ waypoints() [2/2]

template<typename T , typename WaypointsT >
void mc_trajectory::Spline< T, WaypointsT >::waypoints ( const WaypointsT &  waypoints)

Defines waypoints.

Parameters
waypointsWaypoints. Shouldn't include starting and target orientation (use start() and target() instead). Time should be 0<time<duration.

Member Data Documentation

◆ duration_

template<typename T , typename WaypointsT >
double mc_trajectory::Spline< T, WaypointsT >::duration_
protected

◆ needsUpdate_

template<typename T , typename WaypointsT >
bool mc_trajectory::Spline< T, WaypointsT >::needsUpdate_ = false
protected

◆ samples_

template<typename T , typename WaypointsT >
std::vector<T> mc_trajectory::Spline< T, WaypointsT >::samples_
protected

◆ samplingPoints_

template<typename T , typename WaypointsT >
unsigned mc_trajectory::Spline< T, WaypointsT >::samplingPoints_ = 10
protected

◆ start_

template<typename T , typename WaypointsT >
T mc_trajectory::Spline< T, WaypointsT >::start_
protected

◆ target_

template<typename T , typename WaypointsT >
T mc_trajectory::Spline< T, WaypointsT >::target_
protected

◆ waypoints_

template<typename T , typename WaypointsT >
WaypointsT mc_trajectory::Spline< T, WaypointsT >::waypoints_
protected

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