sot-core  4.11.8
Hierarchical task solver plug-in for dynamic-graph.
task.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_TASK_H__
11 #define __SOT_TASK_H__
12 
13 /* --------------------------------------------------------------------- */
14 /* --- INCLUDE --------------------------------------------------------- */
15 /* --------------------------------------------------------------------- */
16 
17 /* Matrix */
18 #include <dynamic-graph/linear-algebra.h>
19 
20 /* STD */
21 #include <string>
22 
23 /* SOT */
26 #include <sot/core/flags.hh>
28 
29 /* --------------------------------------------------------------------- */
30 /* --- API ------------------------------------------------------------- */
31 /* --------------------------------------------------------------------- */
32 
33 #if defined(WIN32)
34 #if defined task_EXPORTS
35 #define SOTTASK_EXPORT __declspec(dllexport)
36 #else
37 #define SOTTASK_EXPORT __declspec(dllimport)
38 #endif
39 #else
40 #define SOTTASK_EXPORT
41 #endif
42 
43 /* --------------------------------------------------------------------- */
44 /* --- CLASS ----------------------------------------------------------- */
45 /* --------------------------------------------------------------------- */
69 namespace dynamicgraph {
70 namespace sot {
71 
73  public:
74  typedef std::list<FeatureAbstract *> FeatureList_t;
75 
76  protected:
79 
81 
82  public:
83  Task(const std::string &n);
84  void initCommands(void);
85 
87  void addFeatureFromName(const std::string &name);
88  void clearFeatureList(void);
89  FeatureList_t &getFeatureList(void) { return featureList; }
90 
91  void setControlSelection(const Flags &act);
92  void addControlSelection(const Flags &act);
94 
95  void setWithDerivative(const bool &s);
96  bool getWithDerivative(void);
97 
98  /* --- COMPUTATION --- */
99  dynamicgraph::Vector &computeError(dynamicgraph::Vector &error, int time);
101  int time);
102  dynamicgraph::Matrix &computeJacobian(dynamicgraph::Matrix &J, int time);
103  dynamicgraph::Vector &computeErrorTimeDerivative(dynamicgraph::Vector &res,
104  int time);
105 
106  /* --- SIGNALS ------------------------------------------------------------ */
107  public:
108  dynamicgraph::SignalPtr<double, int> controlGainSIN;
109  dynamicgraph::SignalPtr<double, int> dampingGainSINOUT;
110  dynamicgraph::SignalPtr<Flags, int> controlSelectionSIN;
111  dynamicgraph::SignalTimeDependent<dynamicgraph::Vector, int> errorSOUT;
112  dynamicgraph::SignalTimeDependent<dynamicgraph::Vector, int>
114 
115  /* --- DISPLAY ------------------------------------------------------------ */
116  void display(std::ostream &os) const;
117 
118  /* --- Writing graph --- */
119  virtual std::ostream &writeGraph(std::ostream &os) const;
120 };
121 
122 } /* namespace sot */
123 } /* namespace dynamicgraph */
124 
125 #endif /* #ifndef __SOT_TASK_H__ */
This class gives the abstract definition of a feature.
Definition: feature-abstract.hh:76
Definition: flags.hh:33
Definition: task-abstract.hh:51
Class that defines the basic elements of a task.
Definition: task.hh:72
virtual std::ostream & writeGraph(std::ostream &os) const
dynamicgraph::SignalTimeDependent< dynamicgraph::Vector, int > errorTimeDerivativeSOUT
Definition: task.hh:113
void display(std::ostream &os) const
void clearControlSelection(void)
dynamicgraph::SignalTimeDependent< dynamicgraph::Vector, int > errorSOUT
Definition: task.hh:111
dynamicgraph::Vector & computeErrorTimeDerivative(dynamicgraph::Vector &res, int time)
void setWithDerivative(const bool &s)
VectorMultiBound & computeTaskExponentialDecrease(VectorMultiBound &errorRef, int time)
Task(const std::string &n)
void setControlSelection(const Flags &act)
void addFeature(FeatureAbstract &s)
dynamicgraph::Matrix & computeJacobian(dynamicgraph::Matrix &J, int time)
dynamicgraph::Vector & computeError(dynamicgraph::Vector &error, int time)
dynamicgraph::SignalPtr< double, int > dampingGainSINOUT
Definition: task.hh:109
bool getWithDerivative(void)
FeatureList_t featureList
Definition: task.hh:77
FeatureList_t & getFeatureList(void)
Definition: task.hh:89
void addFeatureFromName(const std::string &name)
bool withDerivative
Definition: task.hh:78
void addControlSelection(const Flags &act)
dynamicgraph::SignalPtr< Flags, int > controlSelectionSIN
Definition: task.hh:110
std::list< FeatureAbstract * > FeatureList_t
Definition: task.hh:74
dynamicgraph::SignalPtr< double, int > controlGainSIN
Definition: task.hh:108
std::vector< MultiBound > VectorMultiBound
Definition: multi-bound.hh:71
Definition: abstract-sot-external-interface.hh:17
#define SOTTASK_EXPORT
Definition: task.hh:40