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:
73 
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 size_type &nbDof);
152  virtual const size_type &getNbDof() const { return nbJoints; }
153 
155  public: /* --- CONTROL --- */
162  virtual dynamicgraph::Vector &computeControlLaw(dynamicgraph::Vector &control,
163  const sigtime_t &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 */
dynamicgraph::sot::Sot::q0SIN
SignalPtr< dynamicgraph::Vector, sigtime_t > q0SIN
Intrinsec velocity of the robot, that is used to initialized the recurence of the SOT (e....
Definition: sot.hh:185
dynamicgraph::SignalPtr< dynamicgraph::Vector, sigtime_t >
dynamicgraph
dynamicgraph::sot::VectorMultiBound
std::vector< MultiBound > VectorMultiBound
Definition: multi-bound.hh:72
dynamicgraph::Entity
dynamicgraph::sot::Sot::INVERSION_THRESHOLD_DEFAULT
static const double INVERSION_THRESHOLD_DEFAULT
Threshold to compute the dumped pseudo inverse.
Definition: sot.hh:92
dynamicgraph::sot::Sot::proj0SIN
SignalPtr< dynamicgraph::Matrix, sigtime_t > 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
dynamicgraph::sot::TaskAbstract
Definition: task-abstract.hh:51
dynamicgraph::sot::Sot::getNbDof
virtual const size_type & getNbDof() const
Definition: sot.hh:152
dynamicgraph::sot::Sot::~Sot
~Sot(void)
Definition: sot.hh:104
dynamicgraph::sot::Sot
This class implements the Stack of Task. It allows to deal with the priority of the controllers throu...
Definition: sot.hh:57
dynamicgraph::sigtime_t
int64_t sigtime_t
dynamicgraph::sot::Sot::stack
StackType stack
This field is a list of controllers managed by the stack of tasks.
Definition: sot.hh:72
dynamicgraph::sot::Sot::tasks
virtual const StackType & tasks() const
Definition: sot.hh:110
dynamicgraph::sot::Sot::maxControlIncrementSquaredNorm
double maxControlIncrementSquaredNorm
Maximum allowed squared norm of control increment. A task whose control increment is above this value...
Definition: sot.hh:88
dynamicgraph::sot::Sot::inversionThresholdSIN
SignalPtr< double, sigtime_t > inversionThresholdSIN
This signal allow to change the threshold for the damped pseudo-inverse on-line.
Definition: sot.hh:194
dynamicgraph::size_type
Matrix::Index size_type
display
dynamicgraph::sot::Sot::StackType
std::list< TaskAbstract * > StackType
Defines a type for a list of tasks.
Definition: sot.hh:67
dynamicgraph::Vector
Eigen::VectorXd Vector
flags.hh
dynamicgraph::sot::Sot::controlSOUT
SignalTimeDependent< dynamicgraph::Vector, sigtime_t > controlSOUT
Allow to get the result of the computed control law.
Definition: sot.hh:196
linear-algebra.h
dynamicgraph::sot::operator<<
SOT_CORE_EXPORT std::ostream & operator<<(std::ostream &os, const VectorMultiBound &v)
Definition: multi-bound.cpp:228
dynamicgraph::SignalTimeDependent< dynamicgraph::Vector, sigtime_t >
dynamicgraph::sot::Sot::getClassName
virtual const std::string & getClassName() const
Returns the name of this class.
Definition: sot.hh:64
SOTSOT_CORE_EXPORT
#define SOTSOT_CORE_EXPORT
Definition: sot.hh:41
dynamicgraph::sot::Sot::enablePostureTaskAcceleration
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
task-abstract.hh
writeGraph
void writeGraph(const char *filename)
dynamicgraph::sot::Sot::CLASS_NAME
static const std::string CLASS_NAME
Specify the name of the class entity.
Definition: sot.hh:60
dynamicgraph::sot::Sot::nbJoints
size_type nbJoints
Store the number of joints to be used in the command computed by the stack of tasks.
Definition: sot.hh:76
compile.name
name
Definition: compile.py:23


sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Tue Oct 24 2023 02:26:31