Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
dynamicgraph::sot::Sot Class Reference

This class implements the Stack of Task. It allows to deal with the priority of the controllers through the shell. More...

#include <sot.hh>

Inheritance diagram for dynamicgraph::sot::Sot:
Inheritance graph
[legend]

Public Types

typedef std::list< TaskAbstract * > StackType
 Defines a type for a list of tasks. More...
 
- Public Types inherited from dynamicgraph::Entity
typedef std::map< const std::string, command::Command *> CommandMap_t
 
typedef std::map< std::string, SignalBase< int > *> SignalMap
 

Public Member Functions

virtual void defineNbDof (const unsigned int &nbDof)
 This method defines the part of the state vector which correspond to the free flyer of the robot. More...
 
virtual const std::string & getClassName () const
 Returns the name of this class. More...
 
virtual const unsigned int & getNbDof () const
 
 Sot (const std::string &name)
 Default constructor. More...
 
virtual std::ostream & writeGraph (std::ostream &os) const
 This method write the priority between tasks in the output stream os. More...
 
 ~Sot (void)
 
Methods to handle the stack.
virtual const StackTypetasks () const
 
virtual void push (TaskAbstract &task)
 Push the task in the stack. It has a lowest priority than the previous ones. If this is the first task, then it has the highest priority. More...
 
virtual TaskAbstractpop (void)
 Pop the task from the stack. This method removes the task with the smallest priority in the task. The other are projected in the null-space of their predecessors. More...
 
virtual bool exist (const TaskAbstract &task)
 This method allows to know if a task exists or not. More...
 
virtual void remove (const TaskAbstract &task)
 Remove a task regardless to its position in the stack. It removes also the signals connected to the output signal of this stack. More...
 
virtual void removeDependency (const TaskAbstract &key)
 This method removes the output signals depending on this task. More...
 
virtual void up (const TaskAbstract &task)
 This method makes the task to swap with the task having the immediate superior priority. More...
 
virtual void down (const TaskAbstract &task)
 This method makes the task to swap with the task having the immediate inferior priority. More...
 
virtual void clear (void)
 Remove all the tasks from the stack. More...
 
Methods to compute the control law following the

recursive definition of the stack of tasks.

virtual dynamicgraph::VectorcomputeControlLaw (dynamicgraph::Vector &control, const int &time)
 Compute the control law. More...
 
- Public Member Functions inherited from dynamicgraph::Entity
std::ostream & displaySignalList (std::ostream &os) const
 
 Entity (const std::string &name)
 
const std::string & getCommandList () const
 
virtual std::string getDocString () const
 
LoggerVerbosity getLoggerVerbosityLevel ()
 
LoggerVerbosity getLoggerVerbosityLevel ()
 
const std::string & getName () const
 
command::CommandgetNewStyleCommand (const std::string &cmdName)
 
CommandMap_t getNewStyleCommandMap ()
 
SignalBase< int > & getSignal (const std::string &signalName)
 
const SignalBase< int > & getSignal (const std::string &signalName) const
 
SignalMap getSignalMap () const
 
double getStreamPrintPeriod ()
 
double getStreamPrintPeriod ()
 
double getTimeSample ()
 
double getTimeSample ()
 
bool hasSignal (const std::string &signame) const
 
Loggerlogger ()
 
Logger const & logger () const
 
Loggerlogger ()
 
Logger const & logger () const
 
void sendMsg (const std::string &msg, MsgType t=MSG_TYPE_INFO, const std::string &lineId="")
 
void sendMsg (const std::string &msg, MsgType t=MSG_TYPE_INFO, const std::string &lineId="")
 
void setLoggerVerbosityLevel (LoggerVerbosity lv)
 
void setLoggerVerbosityLevel (LoggerVerbosity lv)
 
bool setStreamPrintPeriod (double t)
 
bool setStreamPrintPeriod (double t)
 
bool setTimeSample (double t)
 
bool setTimeSample (double t)
 
virtual SignalBase< int > * test ()
 
virtual void test2 (SignalBase< int > *)
 
virtual std::ostream & writeCompletionList (std::ostream &os) const
 
virtual ~Entity ()
 

Static Public Member Functions

static void taskVectorToMlVector (const VectorMultiBound &taskVector, Vector &err)
 Number of joints by default. More...
 

Public Attributes

Methods to handle signals
SignalPtr< dynamicgraph::Vector, int > q0SIN
 Intrinsec velocity of the robot, that is used to initialized the recurence of the SOT (e.g. velocity coming from the other OpenHRP plugins). More...
 
SignalPtr< dynamicgraph::Matrix, int > proj0SIN
 A matrix K whose columns are a base of the desired velocity. In other words, $ \dot{q} = K * u $ where $ u $ is the free parameter to be computed. More...
 
SignalPtr< double, int > inversionThresholdSIN
 This signal allow to change the threshold for the damped pseudo-inverse on-line. More...
 
SignalTimeDependent< dynamicgraph::Vector, int > controlSOUT
 Allow to get the result of the computed control law. More...
 

Static Public Attributes

static const std::string CLASS_NAME
 Specify the name of the class entity. More...
 
static const double INVERSION_THRESHOLD_DEFAULT = 1e-4
 Threshold to compute the dumped pseudo inverse. More...
 

Protected Attributes

bool enablePostureTaskAcceleration
 Option to disable the computation of the SVD for the last task if this task is a Task with a single FeaturePosture. More...
 
double maxControlIncrementSquaredNorm
 Maximum allowed squared norm of control increment. A task whose control increment is above this value is discarded. It defaults to std::numeric_limits<double>::max(). More...
 
unsigned int nbJoints
 Store the number of joints to be used in the command computed by the stack of tasks. More...
 
StackType stack
 This field is a list of controllers managed by the stack of tasks. More...
 
- Protected Attributes inherited from dynamicgraph::Entity
CommandMap_t commandMap
 
Logger logger_
 
std::string name
 
SignalMap signalMap
 

Methods to display the stack of tasks.

virtual void display (std::ostream &os) const
 
SOTSOT_CORE_EXPORT friend std::ostream & operator<< (std::ostream &os, const Sot &sot)
 

Additional Inherited Members

- Protected Member Functions inherited from dynamicgraph::Entity
void addCommand (const std::string &name, command::Command *command)
 
void entityDeregistration ()
 
void entityRegistration ()
 
void signalDeregistration (const std::string &name)
 
void signalRegistration (const SignalArray< int > &signals)
 

Detailed Description

This class implements the Stack of Task. It allows to deal with the priority of the controllers through the shell.

Definition at line 57 of file sot.hh.

Member Typedef Documentation

◆ StackType

Defines a type for a list of tasks.

Definition at line 67 of file sot.hh.

Constructor & Destructor Documentation

◆ Sot()

Sot::Sot ( const std::string &  name)

Default constructor.

Definition at line 62 of file sot.cpp.

◆ ~Sot()

dynamicgraph::sot::Sot::~Sot ( void  )
inline

Definition at line 104 of file sot.hh.

Member Function Documentation

◆ clear()

void Sot::clear ( void  )
virtual

Remove all the tasks from the stack.

Definition at line 311 of file sot.cpp.

◆ computeControlLaw()

dynamicgraph::Vector & Sot::computeControlLaw ( dynamicgraph::Vector control,
const int &  time 
)
virtual

Compute the control law.

Computing first the jacobian may be a little faster overall.

Definition at line 469 of file sot.cpp.

◆ defineNbDof()

void Sot::defineNbDof ( const unsigned int &  nbDof)
virtual

This method defines the part of the state vector which correspond to the free flyer of the robot.

Definition at line 319 of file sot.cpp.

◆ display()

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

Display the stack of tasks in text mode as a tree.

Reimplemented from dynamicgraph::Entity.

Definition at line 648 of file sot.cpp.

◆ down()

void Sot::down ( const TaskAbstract task)
virtual

This method makes the task to swap with the task having the immediate inferior priority.

Definition at line 282 of file sot.cpp.

◆ exist()

bool Sot::exist ( const TaskAbstract task)
virtual

This method allows to know if a task exists or not.

Definition at line 227 of file sot.cpp.

◆ getClassName()

virtual const std::string& dynamicgraph::sot::Sot::getClassName ( void  ) const
inlinevirtual

Returns the name of this class.

Reimplemented from dynamicgraph::Entity.

Definition at line 64 of file sot.hh.

◆ getNbDof()

virtual const unsigned int& dynamicgraph::sot::Sot::getNbDof ( ) const
inlinevirtual

Definition at line 152 of file sot.hh.

◆ pop()

TaskAbstract & Sot::pop ( void  )
virtual

Pop the task from the stack. This method removes the task with the smallest priority in the task. The other are projected in the null-space of their predecessors.

Definition at line 219 of file sot.cpp.

◆ push()

void Sot::push ( TaskAbstract task)
virtual

Push the task in the stack. It has a lowest priority than the previous ones. If this is the first task, then it has the highest priority.

Definition at line 210 of file sot.cpp.

◆ remove()

void Sot::remove ( const TaskAbstract task)
virtual

Remove a task regardless to its position in the stack. It removes also the signals connected to the output signal of this stack.

Definition at line 236 of file sot.cpp.

◆ removeDependency()

void Sot::removeDependency ( const TaskAbstract key)
virtual

This method removes the output signals depending on this task.

Definition at line 253 of file sot.cpp.

◆ tasks()

virtual const StackType& dynamicgraph::sot::Sot::tasks ( ) const
inlinevirtual

Definition at line 110 of file sot.hh.

◆ taskVectorToMlVector()

void Sot::taskVectorToMlVector ( const VectorMultiBound taskVector,
Vector err 
)
static

Number of joints by default.

Definition at line 458 of file sot.cpp.

◆ up()

void Sot::up ( const TaskAbstract task)
virtual

This method makes the task to swap with the task having the immediate superior priority.

Definition at line 259 of file sot.cpp.

◆ writeGraph()

std::ostream & Sot::writeGraph ( std::ostream &  os) const
virtual

This method write the priority between tasks in the output stream os.

Reimplemented from dynamicgraph::Entity.

Definition at line 668 of file sot.cpp.

Friends And Related Function Documentation

◆ operator<<

SOTSOT_CORE_EXPORT friend std::ostream& operator<< ( std::ostream &  os,
const Sot sot 
)
friend

Wrap the previous method around an operator.

Definition at line 659 of file sot.cpp.

Member Data Documentation

◆ CLASS_NAME

const std::string dynamicgraph::sot::Sot::CLASS_NAME
static

Specify the name of the class entity.

Definition at line 60 of file sot.hh.

◆ controlSOUT

SignalTimeDependent<dynamicgraph::Vector, int> dynamicgraph::sot::Sot::controlSOUT

Allow to get the result of the computed control law.

Definition at line 196 of file sot.hh.

◆ enablePostureTaskAcceleration

bool dynamicgraph::sot::Sot::enablePostureTaskAcceleration
protected

Option to disable the computation of the SVD for the last task if this task is a Task with a single FeaturePosture.

Definition at line 80 of file sot.hh.

◆ INVERSION_THRESHOLD_DEFAULT

const double Sot::INVERSION_THRESHOLD_DEFAULT = 1e-4
static

Threshold to compute the dumped pseudo inverse.

Definition at line 92 of file sot.hh.

◆ inversionThresholdSIN

SignalPtr<double, int> dynamicgraph::sot::Sot::inversionThresholdSIN

This signal allow to change the threshold for the damped pseudo-inverse on-line.

Definition at line 194 of file sot.hh.

◆ maxControlIncrementSquaredNorm

double dynamicgraph::sot::Sot::maxControlIncrementSquaredNorm
protected

Maximum allowed squared norm of control increment. A task whose control increment is above this value is discarded. It defaults to std::numeric_limits<double>::max().

Warning
This is a security feature and is not a good way of adding a proper constraint on the control generated by SoT.

Definition at line 88 of file sot.hh.

◆ nbJoints

unsigned int dynamicgraph::sot::Sot::nbJoints
protected

Store the number of joints to be used in the command computed by the stack of tasks.

Definition at line 76 of file sot.hh.

◆ proj0SIN

SignalPtr<dynamicgraph::Matrix, int> dynamicgraph::sot::Sot::proj0SIN

A matrix K whose columns are a base of the desired velocity. In other words, $ \dot{q} = K * u $ where $ u $ is the free parameter to be computed.

Note
K should be an orthonormal matrix.

Definition at line 191 of file sot.hh.

◆ q0SIN

SignalPtr<dynamicgraph::Vector, int> dynamicgraph::sot::Sot::q0SIN

Intrinsec velocity of the robot, that is used to initialized the recurence of the SOT (e.g. velocity coming from the other OpenHRP plugins).

Definition at line 185 of file sot.hh.

◆ stack

StackType dynamicgraph::sot::Sot::stack
protected

This field is a list of controllers managed by the stack of tasks.

Definition at line 72 of file sot.hh.


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


sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Wed Jun 21 2023 02:51:27