sot.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2010,
3  * François Bleibel,
4  * Olivier Stasse,
5  *
6  * CNRS/AIST
7  *
8  */
9 
10 #ifndef __SOT_SOT_HH
11 #define __SOT_SOT_HH
12 
13 /* --------------------------------------------------------------------- */
14 /* --- INCLUDE --------------------------------------------------------- */
15 /* --------------------------------------------------------------------- */
16 
17 /* Matrix */
19 
20 /* Classes standards. */
21 #include <list> /* Classe std::list */
22 
23 /* SOT */
24 #include <dynamic-graph/entity.h>
25 
26 #include <sot/core/flags.hh>
28 
29 /* --------------------------------------------------------------------- */
30 /* --- API ------------------------------------------------------------- */
31 /* --------------------------------------------------------------------- */
32 
33 #ifndef SOTSOT_CORE_EXPORT
34 #if defined(WIN32)
35 #if defined(sot_EXPORTS)
36 #define SOTSOT_CORE_EXPORT __declspec(dllexport)
37 #else
38 #define SOTSOT_CORE_EXPORT __declspec(dllimport)
39 #endif
40 #else
41 #define SOTSOT_CORE_EXPORT
42 #endif
43 #endif
44 
45 /* --------------------------------------------------------------------- */
46 /* --- CLASS ----------------------------------------------------------- */
47 /* --------------------------------------------------------------------- */
48 
49 namespace dynamicgraph {
50 namespace sot {
51 
57 class SOTSOT_CORE_EXPORT Sot : public Entity {
58  public:
60  static const std::string CLASS_NAME;
61 
62  public:
64  virtual const std::string &getClassName() const { return CLASS_NAME; }
65 
67  typedef std::list<TaskAbstract *> StackType;
68 
69  protected:
72  StackType stack;
73 
76  unsigned int nbJoints;
77 
81 
89 
90  public:
92  static const double INVERSION_THRESHOLD_DEFAULT; // = 1e-4;
93 
94  /* static const double DIRECTIONAL_THRESHOLD_DEFAULT = 1e-2; */
95  /* static const bool USE_CONTI_INVERSE_DEFAULT = false; */
96 
98  static void taskVectorToMlVector(const VectorMultiBound &taskVector,
99  Vector &err);
100 
101  public:
103  Sot(const std::string &name);
104  ~Sot(void) { /* TODO!! */
105  }
106 
110  virtual const StackType &tasks() const { return stack; }
111 
116  virtual void push(TaskAbstract &task);
121  virtual TaskAbstract &pop(void);
122 
124  virtual bool exist(const TaskAbstract &task);
125 
129  virtual void remove(const TaskAbstract &task);
130 
133  virtual void removeDependency(const TaskAbstract &key);
134 
137  virtual void up(const TaskAbstract &task);
138 
141  virtual void down(const TaskAbstract &task);
142 
144  virtual void clear(void);
151  virtual void defineNbDof(const unsigned int &nbDof);
152  virtual const unsigned int &getNbDof() const { return nbJoints; }
153 
155  public: /* --- CONTROL --- */
162  virtual dynamicgraph::Vector &computeControlLaw(dynamicgraph::Vector &control,
163  const int &time);
164 
167  public: /* --- DISPLAY --- */
172  virtual void display(std::ostream &os) const;
174  SOTSOT_CORE_EXPORT friend std::ostream &operator<<(std::ostream &os,
175  const Sot &sot);
177  public: /* --- SIGNALS --- */
201  virtual std::ostream &writeGraph(std::ostream &os) const;
202 };
203 } // namespace sot
204 } // namespace dynamicgraph
205 
206 #endif /* #ifndef __SOT_SOT_HH */
Eigen::VectorXd Vector
SignalTimeDependent< dynamicgraph::Vector, int > controlSOUT
Allow to get the result of the computed control law.
Definition: sot.hh:196
std::vector< MultiBound > VectorMultiBound
Definition: multi-bound.hh:71
virtual const unsigned int & getNbDof() const
Definition: sot.hh:152
SignalPtr< double, int > inversionThresholdSIN
This signal allow to change the threshold for the damped pseudo-inverse on-line.
Definition: sot.hh:194
double maxControlIncrementSquaredNorm
Maximum allowed squared norm of control increment. A task whose control increment is above this value...
Definition: sot.hh:88
SignalPtr< dynamicgraph::Vector, int > q0SIN
Intrinsec velocity of the robot, that is used to initialized the recurence of the SOT (e...
Definition: sot.hh:185
SignalPtr< dynamicgraph::Matrix, int > proj0SIN
A matrix K whose columns are a base of the desired velocity. In other words, where is the free para...
Definition: sot.hh:191
bool enablePostureTaskAcceleration
Option to disable the computation of the SVD for the last task if this task is a Task with a single F...
Definition: sot.hh:80
static const double INVERSION_THRESHOLD_DEFAULT
Threshold to compute the dumped pseudo inverse.
Definition: sot.hh:92
std::list< TaskAbstract * > StackType
Defines a type for a list of tasks.
Definition: sot.hh:67
SOT_CORE_EXPORT std::ostream & operator<<(std::ostream &os, const VectorMultiBound &v)
StackType stack
This field is a list of controllers managed by the stack of tasks.
Definition: sot.hh:72
unsigned int nbJoints
Store the number of joints to be used in the command computed by the stack of tasks.
Definition: sot.hh:76
static const std::string CLASS_NAME
Specify the name of the class entity.
Definition: sot.hh:60
virtual const StackType & tasks() const
Definition: sot.hh:110
This class implements the Stack of Task. It allows to deal with the priority of the controllers throu...
Definition: sot.hh:57
void writeGraph(const char *filename)
#define SOTSOT_CORE_EXPORT
Definition: sot.hh:41
virtual const std::string & getClassName() const
Returns the name of this class.
Definition: sot.hh:64


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