sot-torque-control  1.5.2
SE3TrajectoryGenerator Class Reference

#include <sot/torque_control/se3-trajectory-generator.hh>

Inheritance diagram for SE3TrajectoryGenerator:
[legend]
Collaboration diagram for SE3TrajectoryGenerator:
[legend]

Public Member Functions

 SE3TrajectoryGenerator (const std::string &name)
 
 DECLARE_SIGNAL (x, OUT, dynamicgraph::Vector)
 
 DECLARE_SIGNAL_IN (initial_value, dynamicgraph::Vector)
 
 DECLARE_SIGNAL_IN (trigger, bool)
 
 DECLARE_SIGNAL_OUT (ddx, dynamicgraph::Vector)
 
 DECLARE_SIGNAL_OUT (dx, dynamicgraph::Vector)
 
virtual void display (std::ostream &os) const
 
void getValue (const int &id)
 
void init (const double &dt)
 
void move (const int &id, const double &xFinal, const double &time)
 
void playTrajectoryFile (const std::string &fileName)
 
void sendMsg (const std::string &msg, MsgType t=MSG_TYPE_INFO, const char *="", int=0)
 
void setSpline (const std::string &filename, const double &timeToInitConf, const Eigen::MatrixXd &init_rotation)
 
void startConstAcc (const int &id, const double &xFinal, const double &time)
 
void startLinearChirp (const int &id, const double &xFinal, const double &f0, const double &f1, const double &time)
 
void startSinusoid (const int &id, const double &xFinal, const double &time)
 
void startSpline ()
 
void startTriangle (const int &id, const double &xFinal, const double &time, const double &Tacc)
 
void stop (const int &id)
 

Protected Types

enum  TG_Status {
  TG_STOP,
  TG_SINUSOID,
  TG_MIN_JERK,
  TG_LIN_CHIRP,
  TG_TRIANGLE,
  TG_CONST_ACC,
  TG_TEXT_FILE,
  TG_SPLINE
}
 

Protected Member Functions

 DECLARE_SIGNAL_OUT_FUNCTION (x, dynamicgraph::Vector)
 

Protected Attributes

std::vector< ConstantAccelerationTrajectoryGenerator * > m_constAccTrajGen
 
std::vector< AbstractTrajectoryGenerator * > m_currentTrajGen
 status of the component More...
 
double m_dt
 true if it is the first iteration, false otherwise More...
 
bool m_firstIter
 true if the entity has been successfully initialized More...
 
bool m_initSucceeded
 
unsigned int m_iterLast
 size of velocity vector More...
 
std::vector< LinearChirpTrajectoryGenerator * > m_linChirpTrajGen
 
std::vector< MinimumJerkTrajectoryGenerator * > m_minJerkTrajGen
 
std::vector< NoTrajectoryGenerator * > m_noTrajGen
 
unsigned int m_np
 control loop time period More...
 
unsigned int m_nv
 size of position vector More...
 
std::vector< SinusoidTrajectoryGenerator * > m_sinTrajGen
 
bool m_splineReady
 
Eigen::Matrix3d m_splineRotation
 
parametriccurves::Spline< double, Eigen::Dynamic > * m_splineTrajGen
 
std::vector< TG_Statusm_status
 
double m_t
 last iter index More...
 
TextFileTrajectoryGeneratorm_textFileTrajGen
 
std::vector< TriangleTrajectoryGenerator * > m_triangleTrajGen
 

Detailed Description

Definition at line 46 of file se3-trajectory-generator.hh.

Member Enumeration Documentation

◆ TG_Status

enum TG_Status
protected
Enumerator
TG_STOP 
TG_SINUSOID 
TG_MIN_JERK 
TG_LIN_CHIRP 
TG_TRIANGLE 
TG_CONST_ACC 
TG_TEXT_FILE 
TG_SPLINE 

Definition at line 129 of file se3-trajectory-generator.hh.

Constructor & Destructor Documentation

◆ SE3TrajectoryGenerator()

Member Function Documentation

◆ DECLARE_SIGNAL()

DECLARE_SIGNAL ( ,
OUT  ,
dynamicgraph::Vector   
)

◆ DECLARE_SIGNAL_IN() [1/2]

DECLARE_SIGNAL_IN ( initial_value  ,
dynamicgraph::Vector   
)

◆ DECLARE_SIGNAL_IN() [2/2]

DECLARE_SIGNAL_IN ( trigger  ,
bool   
)

◆ DECLARE_SIGNAL_OUT() [1/2]

DECLARE_SIGNAL_OUT ( ddx  ,
dynamicgraph::Vector   
)

◆ DECLARE_SIGNAL_OUT() [2/2]

DECLARE_SIGNAL_OUT ( dx  ,
dynamicgraph::Vector   
)

◆ DECLARE_SIGNAL_OUT_FUNCTION()

DECLARE_SIGNAL_OUT_FUNCTION ( ,
dynamicgraph::Vector   
)
protected

◆ display()

void display ( std::ostream &  os) const
virtual

Definition at line 496 of file se3-trajectory-generator.cpp.

◆ getValue()

void getValue ( const int &  id)

Print the current value of the specified component.

Definition at line 269 of file se3-trajectory-generator.cpp.

References SE3TrajectoryGenerator::m_currentTrajGen, and SE3TrajectoryGenerator::m_np.

Referenced by SE3TrajectoryGenerator::SE3TrajectoryGenerator().

◆ init()

◆ move()

void move ( const int &  id,
const double &  xFinal,
const double &  time 
)

Move a component to a position with a minimum-jerk trajectory.

Parameters
idinteger index.
xFinalThe desired final position of the component.
timeThe time to go from the current position to xFinal [sec].

Definition at line 454 of file se3-trajectory-generator.cpp.

References SE3TrajectoryGenerator::m_currentTrajGen, SE3TrajectoryGenerator::m_initSucceeded, SE3TrajectoryGenerator::m_minJerkTrajGen, SE3TrajectoryGenerator::m_noTrajGen, SE3TrajectoryGenerator::m_np, SE3TrajectoryGenerator::m_status, SE3TrajectoryGenerator::TG_MIN_JERK, and SE3TrajectoryGenerator::TG_STOP.

Referenced by SE3TrajectoryGenerator::SE3TrajectoryGenerator().

◆ playTrajectoryFile()

◆ sendMsg()

void sendMsg ( const std::string &  msg,
MsgType  t = MSG_TYPE_INFO,
const char *  = "",
int  = 0 
)
inline

Definition at line 124 of file se3-trajectory-generator.hh.

◆ setSpline()

◆ startConstAcc()

void startConstAcc ( const int &  id,
const double &  xFinal,
const double &  time 
)

Start an infinite trajectory with piece-wise constant acceleration.

Parameters
idinteger index.
xFinalThe position of the component corresponding to the max amplitude of the trajectory.
timeThe time to go from the current position to xFinal [sec].
TaccThe time during witch acceleration is keept constant [sec].

Definition at line 412 of file se3-trajectory-generator.cpp.

References SE3TrajectoryGenerator::m_constAccTrajGen, SE3TrajectoryGenerator::m_currentTrajGen, SE3TrajectoryGenerator::m_initSucceeded, SE3TrajectoryGenerator::m_noTrajGen, SE3TrajectoryGenerator::m_np, SE3TrajectoryGenerator::m_status, SE3TrajectoryGenerator::TG_CONST_ACC, and SE3TrajectoryGenerator::TG_STOP.

Referenced by SE3TrajectoryGenerator::SE3TrajectoryGenerator().

◆ startLinearChirp()

void startLinearChirp ( const int &  id,
const double &  xFinal,
const double &  f0,
const double &  f1,
const double &  time 
)

Start a linear-chirp trajectory, that is a sinusoidal trajectory with frequency being a linear function of time.

Parameters
idinteger index.
xFinalThe position of the component corresponding to the max amplitude of the sinusoid [rad].
f0The initial (min) frequency of the sinusoid [Hz]
f1The final (max) frequency of the sinusoid [Hz]
timeThe time to get from f0 to f1 [sec]

Definition at line 429 of file se3-trajectory-generator.cpp.

References SE3TrajectoryGenerator::m_currentTrajGen, SE3TrajectoryGenerator::m_initSucceeded, SE3TrajectoryGenerator::m_linChirpTrajGen, SE3TrajectoryGenerator::m_noTrajGen, SE3TrajectoryGenerator::m_np, SE3TrajectoryGenerator::m_status, SE3TrajectoryGenerator::TG_LIN_CHIRP, and SE3TrajectoryGenerator::TG_STOP.

Referenced by SE3TrajectoryGenerator::SE3TrajectoryGenerator().

◆ startSinusoid()

void startSinusoid ( const int &  id,
const double &  xFinal,
const double &  time 
)

Start an infinite sinusoidal trajectory.

Parameters
idinteger index.
xFinalThe position of the component corresponding to the max amplitude of the sinusoid.
timeThe time to go from the current position to xFinal [sec].

Definition at line 372 of file se3-trajectory-generator.cpp.

References SE3TrajectoryGenerator::m_currentTrajGen, SE3TrajectoryGenerator::m_initSucceeded, SE3TrajectoryGenerator::m_noTrajGen, SE3TrajectoryGenerator::m_np, SE3TrajectoryGenerator::m_sinTrajGen, SE3TrajectoryGenerator::m_status, SE3TrajectoryGenerator::TG_SINUSOID, and SE3TrajectoryGenerator::TG_STOP.

Referenced by SE3TrajectoryGenerator::SE3TrajectoryGenerator().

◆ startSpline()

◆ startTriangle()

void startTriangle ( const int &  id,
const double &  xFinal,
const double &  time,
const double &  Tacc 
)

Start an infinite triangle trajectory.

Parameters
idinteger index.
xFinalThe position of the component corresponding to the max amplitude of the trajectory.
timeThe time to go from the current position to xFinal [sec].

Definition at line 389 of file se3-trajectory-generator.cpp.

References SE3TrajectoryGenerator::m_currentTrajGen, SE3TrajectoryGenerator::m_initSucceeded, SE3TrajectoryGenerator::m_noTrajGen, SE3TrajectoryGenerator::m_np, SE3TrajectoryGenerator::m_status, SE3TrajectoryGenerator::m_triangleTrajGen, SE3TrajectoryGenerator::TG_STOP, and SE3TrajectoryGenerator::TG_TRIANGLE.

Referenced by SE3TrajectoryGenerator::SE3TrajectoryGenerator().

◆ stop()

void stop ( const int &  id)

Member Data Documentation

◆ m_constAccTrajGen

std::vector<ConstantAccelerationTrajectoryGenerator*> m_constAccTrajGen
protected

◆ m_currentTrajGen

◆ m_dt

double m_dt
protected

true if it is the first iteration, false otherwise

Definition at line 142 of file se3-trajectory-generator.hh.

Referenced by SE3TrajectoryGenerator::init().

◆ m_firstIter

bool m_firstIter
protected

true if the entity has been successfully initialized

Definition at line 141 of file se3-trajectory-generator.hh.

Referenced by SE3TrajectoryGenerator::init().

◆ m_initSucceeded

◆ m_iterLast

unsigned int m_iterLast
protected

size of velocity vector

Definition at line 145 of file se3-trajectory-generator.hh.

◆ m_linChirpTrajGen

std::vector<LinearChirpTrajectoryGenerator*> m_linChirpTrajGen
protected

◆ m_minJerkTrajGen

◆ m_noTrajGen

◆ m_np

◆ m_nv

unsigned int m_nv
protected

size of position vector

Definition at line 144 of file se3-trajectory-generator.hh.

◆ m_sinTrajGen

std::vector<SinusoidTrajectoryGenerator*> m_sinTrajGen
protected

◆ m_splineReady

bool m_splineReady
protected

◆ m_splineRotation

Eigen::Matrix3d m_splineRotation
protected

Definition at line 148 of file se3-trajectory-generator.hh.

Referenced by SE3TrajectoryGenerator::setSpline().

◆ m_splineTrajGen

parametriccurves::Spline<double, Eigen::Dynamic>* m_splineTrajGen
protected

◆ m_status

◆ m_t

double m_t
protected

last iter index

Definition at line 147 of file se3-trajectory-generator.hh.

Referenced by SE3TrajectoryGenerator::startSpline(), and SE3TrajectoryGenerator::stop().

◆ m_textFileTrajGen

◆ m_triangleTrajGen

std::vector<TriangleTrajectoryGenerator*> m_triangleTrajGen
protected

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