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 namespace dg = dynamicgraph;
19 
20 /* SOT */
21 #include <dynamic-graph/all-signals.h>
22 #include <dynamic-graph/entity.h>
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 namespace dg = dynamicgraph;
43 
44 /* --------------------------------------------------------------------- */
45 /* --- CLASS ----------------------------------------------------------- */
46 /* --------------------------------------------------------------------- */
47 
48 class SOTCLAMPWORKSPACE_EXPORT ClampWorkspace : public dg::Entity {
49 public:
50  static const std::string CLASS_NAME;
51  virtual const std::string &getClassName(void) const { return CLASS_NAME; }
52 
53  /* --- SIGNALS ------------------------------------------------------------ */
54 public:
55  dg::SignalPtr<MatrixHomogeneous, int> positionrefSIN;
56  dg::SignalPtr<MatrixHomogeneous, int> positionSIN;
57  dg::SignalTimeDependent<dg::Matrix, int> alphaSOUT;
58  dg::SignalTimeDependent<dg::Matrix, int> alphabarSOUT;
59  dg::SignalTimeDependent<MatrixHomogeneous, int> handrefSOUT;
60 
61 public:
62  ClampWorkspace(const std::string &name);
63  virtual ~ClampWorkspace(void) {}
64 
65  void update(int time);
66 
67  virtual dg::Matrix &computeOutput(dg::Matrix &res, int time);
68  virtual dg::Matrix &computeOutputBar(dg::Matrix &res, 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  dg::Matrix alpha;
77  dg::Matrix alphabar;
78  MatrixHomogeneous prefMp;
79  dg::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
dynamicgraph::sot::MatrixHomogeneous
Eigen::Transform< double, 3, Eigen::Affine > SOT_CORE_EXPORT MatrixHomogeneous
Definition: matrix-geometry.hh:74
dynamicgraph
Definition: abstract-sot-external-interface.hh:17
dynamicgraph::sot::ClampWorkspace::positionrefSIN
dg::SignalPtr< MatrixHomogeneous, int > positionrefSIN
Definition: clamp-workspace.hh:55
dynamicgraph::sot::ClampWorkspace::alphabarSOUT
dg::SignalTimeDependent< dg::Matrix, int > alphabarSOUT
Definition: clamp-workspace.hh:58
dynamicgraph::sot::ClampWorkspace
Definition: clamp-workspace.hh:48
dynamicgraph::sot::ClampWorkspace::getClassName
virtual const std::string & getClassName(void) const
Definition: clamp-workspace.hh:51
dynamicgraph::sot::ClampWorkspace::CLASS_NAME
static const std::string CLASS_NAME
Definition: clamp-workspace.hh:50
matrix-geometry.hh
exception-task.hh
dynamicgraph::sot::ClampWorkspace::handrefSOUT
dg::SignalTimeDependent< MatrixHomogeneous, int > handrefSOUT
Definition: clamp-workspace.hh:59
dynamicgraph::sot::ClampWorkspace::alphaSOUT
dg::SignalTimeDependent< dg::Matrix, int > alphaSOUT
Definition: clamp-workspace.hh:57
SOTCLAMPWORKSPACE_EXPORT
#define SOTCLAMPWORKSPACE_EXPORT
Definition: clamp-workspace.hh:37
dynamicgraph::sot::MatrixRotation
Eigen::Matrix< double, 3, 3 > SOT_CORE_EXPORT MatrixRotation
Definition: matrix-geometry.hh:75
dynamicgraph::sot::ClampWorkspace::positionSIN
dg::SignalPtr< MatrixHomogeneous, int > positionSIN
Definition: clamp-workspace.hh:56
dynamicgraph::sot::ClampWorkspace::~ClampWorkspace
virtual ~ClampWorkspace(void)
Definition: clamp-workspace.hh:63