waist-attitude-from-sensor.h
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_WAISTATTITUDEFROMSENSOR_H__
11 #define __SOT_WAISTATTITUDEFROMSENSOR_H__
12 
13 /* --------------------------------------------------------------------- */
14 /* --- INCLUDE --------------------------------------------------------- */
15 /* --------------------------------------------------------------------- */
16 
17 /* Matrix */
18 #include <dynamic-graph/linear-algebra.h>
19 
20 /* SOT */
21 #include <dynamic-graph/entity.h>
22 #include <dynamic-graph/signal-ptr.h>
23 #include <dynamic-graph/signal-time-dependent.h>
24 
25 #include <sot/core/matrix-geometry.hh>
26 
27 /* STD */
28 #include <string>
29 
30 /* --------------------------------------------------------------------- */
31 /* --- API ------------------------------------------------------------- */
32 /* --------------------------------------------------------------------- */
33 
34 #if defined(WIN32)
35 #if defined(waist_attitude_from_sensor_EXPORTS)
36 #define SOTWAISTATTITUDEFROMSENSOR_EXPORT __declspec(dllexport)
37 #else
38 #define SOTWAISTATTITUDEFROMSENSOR_EXPORT __declspec(dllimport)
39 #endif
40 #else
41 #define SOTWAISTATTITUDEFROMSENSOR_EXPORT
42 #endif
43 
44 namespace dynamicgraph {
45 namespace sot {
46 namespace dg = dynamicgraph;
47 
48 /* --------------------------------------------------------------------- */
49 /* --- CLASS ----------------------------------------------------------- */
50 /* --------------------------------------------------------------------- */
51 
53  : public dg::Entity {
54  public:
55  static const std::string CLASS_NAME;
56  virtual const std::string& getClassName(void) const { return CLASS_NAME; }
57 
58  public: /* --- CONSTRUCTION --- */
59  WaistAttitudeFromSensor(const std::string& name);
60  virtual ~WaistAttitudeFromSensor(void);
61 
62  public: /* --- SIGNAL --- */
63  VectorRollPitchYaw& computeAttitudeWaist(VectorRollPitchYaw& res,
64  const int& time);
65 
66  dg::SignalPtr<MatrixRotation, int> attitudeSensorSIN;
67  dg::SignalPtr<MatrixHomogeneous, int> positionSensorSIN;
68  dg::SignalTimeDependent<VectorRollPitchYaw, int> attitudeWaistSOUT;
69 };
70 
72  : public WaistAttitudeFromSensor {
73  public:
74  static const std::string CLASS_NAME;
75 
76  protected:
77  void fromSensor(const bool& inFromSensor) { fromSensor_ = inFromSensor; }
78  bool fromSensor() const { return fromSensor_; }
79 
80  private:
81  bool fromSensor_;
82 
83  public: /* --- CONSTRUCTION --- */
84  WaistPoseFromSensorAndContact(const std::string& name);
86 
87  public: /* --- SIGNAL --- */
88  dynamicgraph::Vector& computePositionWaist(dynamicgraph::Vector& res,
89  const int& time);
90 
91  dg::SignalPtr<MatrixHomogeneous, int> positionContactSIN;
92  dg::SignalTimeDependent<dynamicgraph::Vector, int> positionWaistSOUT;
93 };
94 
95 } /* namespace sot */
96 } /* namespace dynamicgraph */
97 
98 #endif // #ifndef __SOT_WAISTATTITUDEFROMSENSOR_H__
Definition: waist-attitude-from-sensor.h:53
static const std::string CLASS_NAME
Definition: waist-attitude-from-sensor.h:55
virtual const std::string & getClassName(void) const
Definition: waist-attitude-from-sensor.h:56
dg::SignalPtr< MatrixHomogeneous, int > positionSensorSIN
Definition: waist-attitude-from-sensor.h:67
WaistAttitudeFromSensor(const std::string &name)
dg::SignalTimeDependent< VectorRollPitchYaw, int > attitudeWaistSOUT
Definition: waist-attitude-from-sensor.h:68
dg::SignalPtr< MatrixRotation, int > attitudeSensorSIN
Definition: waist-attitude-from-sensor.h:66
VectorRollPitchYaw & computeAttitudeWaist(VectorRollPitchYaw &res, const int &time)
Definition: waist-attitude-from-sensor.h:72
dg::SignalPtr< MatrixHomogeneous, int > positionContactSIN
Definition: waist-attitude-from-sensor.h:91
dg::SignalTimeDependent< dynamicgraph::Vector, int > positionWaistSOUT
Definition: waist-attitude-from-sensor.h:92
WaistPoseFromSensorAndContact(const std::string &name)
void fromSensor(const bool &inFromSensor)
Definition: waist-attitude-from-sensor.h:77
static const std::string CLASS_NAME
Definition: waist-attitude-from-sensor.h:74
bool fromSensor() const
Definition: waist-attitude-from-sensor.h:78
dynamicgraph::Vector & computePositionWaist(dynamicgraph::Vector &res, const int &time)
Definition: angle-estimator.h:43
#define SOTWAISTATTITUDEFROMSENSOR_EXPORT
Definition: waist-attitude-from-sensor.h:41