|
13 | 13 | /* --- API ------------------------------------------------------------- */ |
14 | 14 | /* --------------------------------------------------------------------- */ |
15 | 15 |
|
16 | | -#if defined (WIN32) |
17 | | -# if defined (angle_estimator_EXPORTS) |
18 | | -# define SOTANGLEESTIMATOR_EXPORT __declspec(dllexport) |
19 | | -# else |
20 | | -# define SOTANGLEESTIMATOR_EXPORT __declspec(dllimport) |
21 | | -# endif |
| 16 | +#if defined(WIN32) |
| 17 | +#if defined(angle_estimator_EXPORTS) |
| 18 | +#define SOTANGLEESTIMATOR_EXPORT __declspec(dllexport) |
22 | 19 | #else |
23 | | -# define SOTANGLEESTIMATOR_EXPORT |
| 20 | +#define SOTANGLEESTIMATOR_EXPORT __declspec(dllimport) |
| 21 | +#endif |
| 22 | +#else |
| 23 | +#define SOTANGLEESTIMATOR_EXPORT |
24 | 24 | #endif |
25 | 25 |
|
26 | 26 | /* --------------------------------------------------------------------- */ |
|
30 | 30 | /* Matrix */ |
31 | 31 | #include <dynamic-graph/linear-algebra.h> |
32 | 32 |
|
33 | | - |
34 | 33 | /* SOT */ |
35 | 34 | #include <dynamic-graph/entity.h> |
36 | 35 | #include <dynamic-graph/signal-ptr.h> |
37 | 36 | #include <dynamic-graph/signal-time-dependent.h> |
38 | 37 | #include <sot/core/matrix-geometry.hh> |
39 | 38 |
|
40 | | - |
41 | 39 | /* STD */ |
42 | 40 | #include <string> |
43 | 41 |
|
44 | | - |
45 | | -namespace dynamicgraph { namespace sot { |
| 42 | +namespace dynamicgraph { |
| 43 | +namespace sot { |
46 | 44 | namespace dg = dynamicgraph; |
47 | 45 |
|
48 | 46 | /* --------------------------------------------------------------------- */ |
49 | 47 | /* --- CLASS ----------------------------------------------------------- */ |
50 | 48 | /* --------------------------------------------------------------------- */ |
51 | 49 |
|
52 | | -class SOTANGLEESTIMATOR_EXPORT AngleEstimator |
53 | | -:public dg::Entity |
54 | | -{ |
| 50 | +class SOTANGLEESTIMATOR_EXPORT AngleEstimator : public dg::Entity { |
55 | 51 | public: |
56 | 52 | static const std::string CLASS_NAME; |
57 | | - virtual const std::string& getClassName( void ) const { return CLASS_NAME; } |
| 53 | + virtual const std::string& getClassName(void) const { return CLASS_NAME; } |
58 | 54 |
|
59 | 55 | public: /* --- CONSTRUCTION --- */ |
60 | | - |
61 | | - AngleEstimator( const std::string& name ); |
62 | | - virtual ~AngleEstimator( void ); |
63 | | - |
64 | | - public: /* --- SIGNAL --- */ |
65 | | - |
66 | | - dg::SignalPtr<MatrixRotation,int> sensorWorldRotationSIN; // estimate(worldRc) |
67 | | - dg::SignalPtr<MatrixHomogeneous,int> sensorEmbeddedPositionSIN; // waistRchest |
68 | | - dg::SignalPtr<MatrixHomogeneous,int> contactWorldPositionSIN; // estimate(worldRf) |
69 | | - dg::SignalPtr<MatrixHomogeneous,int> contactEmbeddedPositionSIN; // waistRleg |
70 | | - dg::SignalTimeDependent<dynamicgraph::Vector,int> anglesSOUT; // [ flex1 flex2 yaw_drift ] |
71 | | - dg::SignalTimeDependent<MatrixRotation,int> flexibilitySOUT; // footRleg |
72 | | - dg::SignalTimeDependent<MatrixRotation,int> driftSOUT; // Ryaw = worldRc est(wRc)^-1 |
73 | | - dg::SignalTimeDependent<MatrixRotation,int> sensorWorldRotationSOUT; // worldRc |
74 | | - dg::SignalTimeDependent<MatrixRotation,int> waistWorldRotationSOUT; // worldRwaist |
75 | | - dg::SignalTimeDependent<MatrixHomogeneous,int> waistWorldPositionSOUT; // worldMwaist |
76 | | - dg::SignalTimeDependent<dynamicgraph::Vector,int> waistWorldPoseRPYSOUT; // worldMwaist |
77 | | - |
78 | | - dg::SignalPtr<dynamicgraph::Matrix,int> jacobianSIN; |
79 | | - dg::SignalPtr<dynamicgraph::Vector,int> qdotSIN; |
80 | | - dg::SignalTimeDependent<dynamicgraph::Vector,int> xff_dotSOUT; |
81 | | - dg::SignalTimeDependent<dynamicgraph::Vector,int> qdotSOUT; |
| 56 | + AngleEstimator(const std::string& name); |
| 57 | + virtual ~AngleEstimator(void); |
| 58 | + |
| 59 | + public: /* --- SIGNAL --- */ |
| 60 | + dg::SignalPtr<MatrixRotation, int> sensorWorldRotationSIN; // estimate(worldRc) |
| 61 | + dg::SignalPtr<MatrixHomogeneous, int> sensorEmbeddedPositionSIN; // waistRchest |
| 62 | + dg::SignalPtr<MatrixHomogeneous, int> contactWorldPositionSIN; // estimate(worldRf) |
| 63 | + dg::SignalPtr<MatrixHomogeneous, int> contactEmbeddedPositionSIN; // waistRleg |
| 64 | + dg::SignalTimeDependent<dynamicgraph::Vector, int> anglesSOUT; // [ flex1 flex2 yaw_drift ] |
| 65 | + dg::SignalTimeDependent<MatrixRotation, int> flexibilitySOUT; // footRleg |
| 66 | + dg::SignalTimeDependent<MatrixRotation, int> driftSOUT; // Ryaw = worldRc est(wRc)^-1 |
| 67 | + dg::SignalTimeDependent<MatrixRotation, int> sensorWorldRotationSOUT; // worldRc |
| 68 | + dg::SignalTimeDependent<MatrixRotation, int> waistWorldRotationSOUT; // worldRwaist |
| 69 | + dg::SignalTimeDependent<MatrixHomogeneous, int> waistWorldPositionSOUT; // worldMwaist |
| 70 | + dg::SignalTimeDependent<dynamicgraph::Vector, int> waistWorldPoseRPYSOUT; // worldMwaist |
| 71 | + |
| 72 | + dg::SignalPtr<dynamicgraph::Matrix, int> jacobianSIN; |
| 73 | + dg::SignalPtr<dynamicgraph::Vector, int> qdotSIN; |
| 74 | + dg::SignalTimeDependent<dynamicgraph::Vector, int> xff_dotSOUT; |
| 75 | + dg::SignalTimeDependent<dynamicgraph::Vector, int> qdotSOUT; |
82 | 76 |
|
83 | 77 | public: /* --- FUNCTIONS --- */ |
84 | | - dynamicgraph::Vector& computeAngles( dynamicgraph::Vector& res, |
85 | | - const int& time ); |
86 | | - MatrixRotation& computeFlexibilityFromAngles( MatrixRotation& res, |
87 | | - const int& time ); |
88 | | - MatrixRotation& computeDriftFromAngles( MatrixRotation& res, |
89 | | - const int& time ); |
90 | | - MatrixRotation& computeSensorWorldRotation( MatrixRotation& res, |
91 | | - const int& time ); |
92 | | - MatrixRotation& computeWaistWorldRotation( MatrixRotation& res, |
93 | | - const int& time ); |
94 | | - MatrixHomogeneous& computeWaistWorldPosition( MatrixHomogeneous& res, |
95 | | - const int& time ); |
96 | | - dynamicgraph::Vector& computeWaistWorldPoseRPY( dynamicgraph::Vector& res, |
97 | | - const int& time ); |
98 | | - dynamicgraph::Vector& compute_xff_dotSOUT( dynamicgraph::Vector& res, |
99 | | - const int& time ); |
100 | | - dynamicgraph::Vector& compute_qdotSOUT( dynamicgraph::Vector& res, |
101 | | - const int& time ); |
| 78 | + dynamicgraph::Vector& computeAngles(dynamicgraph::Vector& res, const int& time); |
| 79 | + MatrixRotation& computeFlexibilityFromAngles(MatrixRotation& res, const int& time); |
| 80 | + MatrixRotation& computeDriftFromAngles(MatrixRotation& res, const int& time); |
| 81 | + MatrixRotation& computeSensorWorldRotation(MatrixRotation& res, const int& time); |
| 82 | + MatrixRotation& computeWaistWorldRotation(MatrixRotation& res, const int& time); |
| 83 | + MatrixHomogeneous& computeWaistWorldPosition(MatrixHomogeneous& res, const int& time); |
| 84 | + dynamicgraph::Vector& computeWaistWorldPoseRPY(dynamicgraph::Vector& res, const int& time); |
| 85 | + dynamicgraph::Vector& compute_xff_dotSOUT(dynamicgraph::Vector& res, const int& time); |
| 86 | + dynamicgraph::Vector& compute_qdotSOUT(dynamicgraph::Vector& res, const int& time); |
102 | 87 |
|
103 | 88 | public: /* --- PARAMS --- */ |
104 | 89 | void fromSensor(const bool& fs) { fromSensor_ = fs; } |
105 | | - bool fromSensor() const { return fromSensor_; } |
| 90 | + bool fromSensor() const { return fromSensor_; } |
| 91 | + |
106 | 92 | private: |
107 | 93 | bool fromSensor_; |
108 | | - |
109 | 94 | }; |
110 | 95 |
|
| 96 | +} /* namespace sot */ |
| 97 | +} /* namespace dynamicgraph */ |
111 | 98 |
|
112 | | -} /* namespace sot */} /* namespace dynamicgraph */ |
113 | | - |
114 | | - |
115 | | - |
116 | | -#endif // #ifndef __SOT_ANGLE_ESTIMATOR_H__ |
| 99 | +#endif // #ifndef __SOT_ANGLE_ESTIMATOR_H__ |
0 commit comments