sot-core  4.10.1
Hierarchical task solver plug-in for dynamic-graph.
control-gr.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_Control_GR_HH__
11 #define __SOT_Control_GR_HH__
12 
13 /* --------------------------------------------------------------------- */
14 /* --- INCLUDE --------------------------------------------------------- */
15 /* --------------------------------------------------------------------- */
16 
17 /* Matrix */
18 #include <dynamic-graph/linear-algebra.h>
19 
20 /* SOT */
21 #include <dynamic-graph/entity.h>
22 #include <dynamic-graph/signal-ptr.h>
23 #include <dynamic-graph/signal-time-dependent.h>
24 
25 /* --------------------------------------------------------------------- */
26 /* --- API ------------------------------------------------------------- */
27 /* --------------------------------------------------------------------- */
28 
29 #if defined(WIN32)
30 #if defined(control_gr_EXPORTS)
31 #define ControlGR_EXPORT __declspec(dllexport)
32 #else
33 #define ControlGR_EXPORT __declspec(dllimport)
34 #endif
35 #else
36 #define ControlGR_EXPORT
37 #endif
38 
39 namespace dynamicgraph {
40 namespace sot {
41 
42 /* --------------------------------------------------------------------- */
43 /* --- CLASS ----------------------------------------------------------- */
44 /* --------------------------------------------------------------------- */
45 
46 class ControlGR_EXPORT ControlGR : public Entity {
47 
48 public: /* --- CONSTRUCTOR ---- */
49  ControlGR(const std::string &name);
50 
51 public: /* --- INIT --- */
52  void init(const double &step);
53 
54 public: /* --- CONSTANTS --- */
55  /* Default values. */
56  static const double TIME_STEP_DEFAULT; // = 0.001
57 
58 public: /* --- ENTITY INHERITANCE --- */
59  static const std::string CLASS_NAME;
60  virtual void display(std::ostream &os) const;
61  virtual const std::string &getClassName(void) const { return CLASS_NAME; }
62 
63 protected:
64  /* Parameters of the torque-control function:
65  * tau = - A*qddot = g */
66  double TimeStep;
67  double _dimension;
68 
69 public: /* --- SIGNALS --- */
70  SignalPtr<dynamicgraph::Matrix, int> matrixASIN;
71  SignalPtr<dynamicgraph::Vector, int> accelerationSIN;
72  SignalPtr<dynamicgraph::Vector, int> gravitySIN;
73  SignalTimeDependent<dynamicgraph::Vector, int> controlSOUT;
74 
75 protected:
76  double &setsize(int dimension);
77  dynamicgraph::Vector &computeControl(dynamicgraph::Vector &tau, int t);
78 };
79 
80 } // namespace sot
81 } // namespace dynamicgraph
82 
83 #endif // #ifndef __SOT_Control_GR_HH__
static const double TIME_STEP_DEFAULT
Definition: control-gr.hh:56
static const std::string CLASS_NAME
Definition: control-gr.hh:59
SignalPtr< dynamicgraph::Vector, int > gravitySIN
Definition: control-gr.hh:72
SignalPtr< dynamicgraph::Vector, int > accelerationSIN
Definition: control-gr.hh:71
SignalPtr< dynamicgraph::Matrix, int > matrixASIN
Definition: control-gr.hh:70
#define ControlGR_EXPORT
Definition: control-gr.hh:36
double _dimension
Definition: control-gr.hh:67
SignalTimeDependent< dynamicgraph::Vector, int > controlSOUT
Definition: control-gr.hh:73
Definition: control-gr.hh:46
virtual const std::string & getClassName(void) const
Definition: control-gr.hh:61
Definition: abstract-sot-external-interface.hh:17
double TimeStep
Definition: control-gr.hh:66