GCC Code Coverage Report


Directory: ./
File: include/sot/core/clamp-workspace.hh
Date: 2024-10-13 12:22:59
Exec Total Coverage
Lines: 0 2 0.0%
Branches: 0 0 -%

Line Branch Exec Source
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
23 #include <sot/core/exception-task.hh>
24 #include <sot/core/matrix-geometry.hh>
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);
70 virtual MatrixHomogeneous &computeRef(MatrixHomogeneous &res, 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
103