sot-core  4.11.2
Hierarchical task solver plug-in for dynamic-graph.
clamp-workspace.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_CLAMP_WORKSPACE_HH__
11 #define __SOT_CLAMP_WORKSPACE_HH__
12 
13 /* STL */
14 #include <utility>
15 
16 /* Matrix */
17 #include <dynamic-graph/linear-algebra.h>
18 
19 /* SOT */
20 #include <dynamic-graph/all-signals.h>
21 #include <dynamic-graph/entity.h>
24 
25 /* --------------------------------------------------------------------- */
26 /* --- API ------------------------------------------------------------- */
27 /* --------------------------------------------------------------------- */
28 
29 #if defined(WIN32)
30 #if defined(clamp_workspace_EXPORTS)
31 #define SOTCLAMPWORKSPACE_EXPORT __declspec(dllexport)
32 #else
33 #define SOTCLAMPWORKSPACE_EXPORT __declspec(dllimport)
34 #endif
35 #else
36 #define SOTCLAMPWORKSPACE_EXPORT
37 #endif
38 
39 namespace dynamicgraph {
40 namespace sot {
41 
42 /* --------------------------------------------------------------------- */
43 /* --- CLASS ----------------------------------------------------------- */
44 /* --------------------------------------------------------------------- */
45 
46 class SOTCLAMPWORKSPACE_EXPORT ClampWorkspace : public dynamicgraph::Entity {
47 public:
48  static const std::string CLASS_NAME;
49  virtual const std::string &getClassName(void) const { return CLASS_NAME; }
50 
51  /* --- SIGNALS ------------------------------------------------------------ */
52 public:
53  dynamicgraph::SignalPtr<MatrixHomogeneous, int> positionrefSIN;
54  dynamicgraph::SignalPtr<MatrixHomogeneous, int> positionSIN;
55  dynamicgraph::SignalTimeDependent<dynamicgraph::Matrix, int> alphaSOUT;
56  dynamicgraph::SignalTimeDependent<dynamicgraph::Matrix, int> alphabarSOUT;
57  dynamicgraph::SignalTimeDependent<MatrixHomogeneous, int> handrefSOUT;
58 
59 public:
60  ClampWorkspace(const std::string &name);
61  virtual ~ClampWorkspace(void) {}
62 
63  void update(int time);
64 
65  virtual dynamicgraph::Matrix &computeOutput(dynamicgraph::Matrix &res,
66  int time);
67  virtual dynamicgraph::Matrix &computeOutputBar(dynamicgraph::Matrix &res,
68  int time);
69  virtual MatrixHomogeneous &computeRef(MatrixHomogeneous &res, int time);
70 
71  virtual void display(std::ostream &) const;
72 
73 private:
74  int timeUpdate;
75 
76  dynamicgraph::Matrix alpha;
77  dynamicgraph::Matrix alphabar;
78  MatrixHomogeneous prefMp;
79  dynamicgraph::Vector pd;
80  MatrixRotation Rd;
81  MatrixHomogeneous handref;
82 
83  double beta;
84  double scale;
85  double dm_min;
86  double dm_max;
87  double dm_min_yaw;
88  double dm_max_yaw;
89  double theta_min;
90  double theta_max;
91  int mode;
92 
93  enum { FRAME_POINT, FRAME_REF } frame;
94 
95  std::pair<double, double> bounds[3];
96 };
97 
98 } /* namespace sot */
99 } /* namespace dynamicgraph */
100 
101 #endif
Eigen::Transform< double, 3, Eigen::Affine > SOT_CORE_EXPORT MatrixHomogeneous
Definition: matrix-geometry.hh:74
virtual const std::string & getClassName(void) const
Definition: clamp-workspace.hh:49
Definition: clamp-workspace.hh:46
dynamicgraph::SignalTimeDependent< dynamicgraph::Matrix, int > alphaSOUT
Definition: clamp-workspace.hh:55
dynamicgraph::SignalTimeDependent< MatrixHomogeneous, int > handrefSOUT
Definition: clamp-workspace.hh:57
dynamicgraph::SignalPtr< MatrixHomogeneous, int > positionrefSIN
Definition: clamp-workspace.hh:53
#define SOTCLAMPWORKSPACE_EXPORT
Definition: clamp-workspace.hh:36
dynamicgraph::SignalTimeDependent< dynamicgraph::Matrix, int > alphabarSOUT
Definition: clamp-workspace.hh:56
Eigen::Matrix< double, 3, 3 > SOT_CORE_EXPORT MatrixRotation
Definition: matrix-geometry.hh:75
virtual ~ClampWorkspace(void)
Definition: clamp-workspace.hh:61
static const std::string CLASS_NAME
Definition: clamp-workspace.hh:48
dynamicgraph::SignalPtr< MatrixHomogeneous, int > positionSIN
Definition: clamp-workspace.hh:54
Definition: abstract-sot-external-interface.hh:17