which-foot-upper.h
Go to the documentation of this file.
1 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2  * Copyright Projet JRL-Japan, 2007
3  *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4  *
5  * File: WhichFootUpper.h
6  * Project: SOT
7  * Author: Nicolas Mansard
8  *
9  * Version control
10  * ===============
11  *
12  * $Id$
13  *
14  * Description
15  * ============
16  *
17  *
18  * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
19 
20 #ifndef __SOT_WhichFootUpper_H__
21 #define __SOT_WhichFootUpper_H__
22 
23 /* --------------------------------------------------------------------- */
24 /* --- INCLUDE --------------------------------------------------------- */
25 /* --------------------------------------------------------------------- */
26 
27 /* SOT */
28 #include <dynamic-graph/entity.h>
29 #include <dynamic-graph/signal-ptr.h>
30 #include <dynamic-graph/signal-time-dependent.h>
31 #include <sot/core/matrix-geometry.hh>
32 
33 /* STD */
34 #include <string>
35 
36 /* --------------------------------------------------------------------- */
37 /* --- API ------------------------------------------------------------- */
38 /* --------------------------------------------------------------------- */
39 
40 #if defined(WIN32)
41 #if defined(which_foot_upper_EXPORTS)
42 #define WhichFootUpper_EXPORT __declspec(dllexport)
43 #else
44 #define WhichFootUpper_EXPORT __declspec(dllimport)
45 #endif
46 #else
47 #define WhichFootUpper_EXPORT
48 #endif
49 
50 namespace dynamicgraph {
51 namespace sot {
52 
53 /* --------------------------------------------------------------------- */
54 /* --- CLASS ----------------------------------------------------------- */
55 /* --------------------------------------------------------------------- */
56 
57 class WhichFootUpper_EXPORT WhichFootUpper : public Entity {
58  public:
60 
61  protected:
62  static const unsigned int INDEX_LEFT_FOOT_DEFAULT;
63  static const unsigned int INDEX_RIGHT_FOOT_DEFAULT;
64  unsigned int indexLeftFoot, indexRightFoot;
65 
66  static const double TRIGGER_THRESHOLD_DEFAULT;
68 
69  unsigned int lastFoot;
70 
71  public: /* --- CONSTRUCTION --- */
72  WhichFootUpper(const std::string &name);
73  virtual ~WhichFootUpper(void);
74 
75  public: /* --- SIGNAL --- */
76  SignalPtr<MatrixRotation, int> waistRsensorSIN;
77  SignalPtr<MatrixRotation, int> worldRsensorSIN;
78  SignalPtr<MatrixHomogeneous, int> waistMlfootSIN;
79  SignalPtr<MatrixHomogeneous, int> waistMrfootSIN;
80 
81  SignalTimeDependent<MatrixHomogeneous, int> worldMlfootSOUT;
82  SignalTimeDependent<MatrixHomogeneous, int> worldMrfootSOUT;
83  SignalTimeDependent<unsigned int, int> whichFootSOUT;
84 
85  SignalPtr<MatrixHomogeneous, int> waistMsensorSIN;
86  SignalTimeDependent<MatrixRotation, int> waistRsensorSOUT;
87 
88  public: /* --- FUNCTIONS --- */
89  static MatrixHomogeneous &computeFootPosition(
90  const MatrixHomogeneous &waistMfoot, const MatrixRotation &waistRsensor,
91  const MatrixRotation &worldRsensor, MatrixHomogeneous &res);
92 
93  MatrixRotation &computeRotationMatrix(MatrixRotation &rotMat, int time);
94 
95  unsigned int &whichFoot(const MatrixHomogeneous &waistMlfoot,
96  const MatrixHomogeneous &waistMrfoot,
97  unsigned int &res);
98 
99  public: /* --- PARAMS --- */
100  virtual void commandLine(const std::string &cmdLine,
101  std::istringstream &cmdArgs, std::ostream &os);
102 };
103 
104 } // namespace sot
105 } // namespace dynamicgraph
106 
107 #endif // #ifndef __SOT_WhichFootUpper_H__
Definition: which-foot-upper.h:57
static const double TRIGGER_THRESHOLD_DEFAULT
Definition: which-foot-upper.h:66
static MatrixHomogeneous & computeFootPosition(const MatrixHomogeneous &waistMfoot, const MatrixRotation &waistRsensor, const MatrixRotation &worldRsensor, MatrixHomogeneous &res)
SignalPtr< MatrixHomogeneous, int > waistMsensorSIN
Definition: which-foot-upper.h:85
SignalPtr< MatrixRotation, int > waistRsensorSIN
Definition: which-foot-upper.h:76
SignalTimeDependent< MatrixHomogeneous, int > worldMlfootSOUT
Definition: which-foot-upper.h:81
SignalPtr< MatrixHomogeneous, int > waistMlfootSIN
Definition: which-foot-upper.h:78
static const unsigned int INDEX_RIGHT_FOOT_DEFAULT
Definition: which-foot-upper.h:63
MatrixRotation & computeRotationMatrix(MatrixRotation &rotMat, int time)
WhichFootUpper(const std::string &name)
unsigned int lastFoot
Definition: which-foot-upper.h:69
unsigned int indexLeftFoot
Definition: which-foot-upper.h:64
virtual void commandLine(const std::string &cmdLine, std::istringstream &cmdArgs, std::ostream &os)
SignalPtr< MatrixHomogeneous, int > waistMrfootSIN
Definition: which-foot-upper.h:79
SignalTimeDependent< MatrixRotation, int > waistRsensorSOUT
Definition: which-foot-upper.h:86
double triggerThreshold
Definition: which-foot-upper.h:67
SignalTimeDependent< MatrixHomogeneous, int > worldMrfootSOUT
Definition: which-foot-upper.h:82
SignalTimeDependent< unsigned int, int > whichFootSOUT
Definition: which-foot-upper.h:83
static const unsigned int INDEX_LEFT_FOOT_DEFAULT
Definition: which-foot-upper.h:62
unsigned int & whichFoot(const MatrixHomogeneous &waistMlfoot, const MatrixHomogeneous &waistMrfoot, unsigned int &res)
SignalPtr< MatrixRotation, int > worldRsensorSIN
Definition: which-foot-upper.h:77
Definition: exception-pg.h:47
#define WhichFootUpper_EXPORT
Definition: which-foot-upper.h:47