- 3.0.2 rigid body dynamics module.
ct::rbd::tpl::SingleDOFTrajectoryGenerator< SCALAR > Class Template Reference

#include <SingleDOFTrajectoryGenerator.h>

Public Member Functions

 SingleDOFTrajectoryGenerator ()
 
 SingleDOFTrajectoryGenerator (const SCALAR x0, const SCALAR xT, SCALAR abs_v_max, SCALAR abs_a_max)
 
SCALAR setup (const SCALAR x0, const SCALAR xT, SCALAR abs_v_max, SCALAR abs_a_max)
 
void queryTrajectory (const SCALAR time, SCALAR &x_new, SCALAR &v_new)
 

Protected Types

enum  MODE { ACCELERATE_AND_DECELERATE = 0, ACCELERATE_HOLD_DECELERATE = 1 }
 

Detailed Description

template<typename SCALAR = double>
class ct::rbd::tpl::SingleDOFTrajectoryGenerator< SCALAR >

Generate a simple trajectory for a single degree of freedom

  • the initial and target value
  • the max allowed acceleration and deceleration

This class comprises two different modes:

1) If the position distance to be bridged is too small to reach the maximum velocity through constant acceleration/deceleration, it simply constantly accelerates until the middle of the path and constantly decelerates after it.

2) Otherwise, it accelerates to the maximum velocity and then stays at that desired velocity. It starts decelerating just in time to reach zero velocity at the target point.

Member Enumeration Documentation

◆ MODE

template<typename SCALAR = double>
enum ct::rbd::tpl::SingleDOFTrajectoryGenerator::MODE
protected
Enumerator
ACCELERATE_AND_DECELERATE 
ACCELERATE_HOLD_DECELERATE 

Constructor & Destructor Documentation

◆ SingleDOFTrajectoryGenerator() [1/2]

template<typename SCALAR = double>
ct::rbd::tpl::SingleDOFTrajectoryGenerator< SCALAR >::SingleDOFTrajectoryGenerator ( )
inline

◆ SingleDOFTrajectoryGenerator() [2/2]

template<typename SCALAR = double>
ct::rbd::tpl::SingleDOFTrajectoryGenerator< SCALAR >::SingleDOFTrajectoryGenerator ( const SCALAR  x0,
const SCALAR  xT,
SCALAR  abs_v_max,
SCALAR  abs_a_max 
)
inline

Member Function Documentation

◆ setup()

template<typename SCALAR = double>
SCALAR ct::rbd::tpl::SingleDOFTrajectoryGenerator< SCALAR >::setup ( const SCALAR  x0,
const SCALAR  xT,
SCALAR  abs_v_max,
SCALAR  abs_a_max 
)
inline
Parameters
x0starting value for x
xTend value for x
abs_v_maxmaximal absolute velocity for the trajectory
abs_a_maxmaximal absolute acceleration for the trajectory
Warning
this generator currently only supports zero start and end velocities
Returns
the total trajectory time horizon computed from the given parameters.

References ct::rbd::tpl::SingleDOFTrajectoryGenerator< SCALAR >::ACCELERATE_AND_DECELERATE, and ct::rbd::tpl::SingleDOFTrajectoryGenerator< SCALAR >::ACCELERATE_HOLD_DECELERATE.

Referenced by ct::rbd::tpl::SingleDOFTrajectoryGenerator< SCALAR >::SingleDOFTrajectoryGenerator().

◆ queryTrajectory()

template<typename SCALAR = double>
void ct::rbd::tpl::SingleDOFTrajectoryGenerator< SCALAR >::queryTrajectory ( const SCALAR  time,
SCALAR x_new,
SCALAR v_new 
)
inline
Parameters
timethe trajectory query time
x_newreturns the evaluated value for position
v_newreturns the evaluated value for velocity
Todo:
check and resolve why times would not be allowed to be negative.

References ct::rbd::tpl::SingleDOFTrajectoryGenerator< SCALAR >::ACCELERATE_AND_DECELERATE, and ct::rbd::tpl::SingleDOFTrajectoryGenerator< SCALAR >::ACCELERATE_HOLD_DECELERATE.


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