sot-torque-control  1.6.3
Collection of dynamic-graph entities aimed at implementing torque control on different robots.
SE3TrajectoryGenerator Class Reference

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

Inheritance diagram for SE3TrajectoryGenerator:
Collaboration diagram for SE3TrajectoryGenerator:

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 47 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 140 of file se3-trajectory-generator.hh.

Constructor & Destructor Documentation

◆ SE3TrajectoryGenerator()

SE3TrajectoryGenerator ( const std::string &  name)

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

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 620 of file se3-trajectory-generator.cpp.

◆ getValue()

void getValue ( const int &  id)

Print the current value of the specified component.

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

◆ init()

void init ( const double &  dt)

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

◆ 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 568 of file se3-trajectory-generator.cpp.

◆ playTrajectoryFile()

void playTrajectoryFile ( const std::string &  fileName)

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

◆ sendMsg()

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

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

◆ setSpline()

void setSpline ( const std::string &  filename,
const double &  timeToInitConf,
const Eigen::MatrixXd &  init_rotation 
)

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

◆ 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 493 of file se3-trajectory-generator.cpp.

◆ 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 521 of file se3-trajectory-generator.cpp.

◆ 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 431 of file se3-trajectory-generator.cpp.

◆ startSpline()

void startSpline ( )

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

◆ 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 459 of file se3-trajectory-generator.cpp.

◆ stop()

void stop ( const int &  id)

Stop the motion of the specified component. If id is -1 it stops the trajectory of all the vector.

Parameters
idinteger index.

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

Member Data Documentation

◆ m_constAccTrajGen

std::vector<ConstantAccelerationTrajectoryGenerator*> m_constAccTrajGen
protected

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

◆ m_currentTrajGen

std::vector<AbstractTrajectoryGenerator*> m_currentTrajGen
protected

status of the component

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

◆ m_dt

double m_dt
protected

true if it is the first iteration, false otherwise

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

◆ m_firstIter

bool m_firstIter
protected

true if the entity has been successfully initialized

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

◆ m_initSucceeded

bool m_initSucceeded
protected

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

◆ m_iterLast

unsigned int m_iterLast
protected

size of velocity vector

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

◆ m_linChirpTrajGen

std::vector<LinearChirpTrajectoryGenerator*> m_linChirpTrajGen
protected

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

◆ m_minJerkTrajGen

std::vector<MinimumJerkTrajectoryGenerator*> m_minJerkTrajGen
protected

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

◆ m_noTrajGen

std::vector<NoTrajectoryGenerator*> m_noTrajGen
protected

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

◆ m_np

unsigned int m_np
protected

control loop time period

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

◆ m_nv

unsigned int m_nv
protected

size of position vector

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

◆ m_sinTrajGen

std::vector<SinusoidTrajectoryGenerator*> m_sinTrajGen
protected

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

◆ m_splineReady

bool m_splineReady
protected

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

◆ m_splineRotation

Eigen::Matrix3d m_splineRotation
protected

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

◆ m_splineTrajGen

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

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

◆ m_status

std::vector<TG_Status> m_status
protected

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

◆ m_t

double m_t
protected

last iter index

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

◆ m_textFileTrajGen

TextFileTrajectoryGenerator* m_textFileTrajGen
protected

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

◆ m_triangleTrajGen

std::vector<TriangleTrajectoryGenerator*> m_triangleTrajGen
protected

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


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