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