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 
32 #include <sot/core/matrix-geometry.hh>
33 
34 /* STD */
35 #include <string>
36 
37 /* --------------------------------------------------------------------- */
38 /* --- API ------------------------------------------------------------- */
39 /* --------------------------------------------------------------------- */
40 
41 #if defined(WIN32)
42 #if defined(which_foot_upper_EXPORTS)
43 #define WhichFootUpper_EXPORT __declspec(dllexport)
44 #else
45 #define WhichFootUpper_EXPORT __declspec(dllimport)
46 #endif
47 #else
48 #define WhichFootUpper_EXPORT
49 #endif
50 
51 namespace dynamicgraph {
52 namespace sot {
53 
54 /* --------------------------------------------------------------------- */
55 /* --- CLASS ----------------------------------------------------------- */
56 /* --------------------------------------------------------------------- */
57 
58 class WhichFootUpper_EXPORT WhichFootUpper : public Entity {
59  public:
60  DYNAMIC_GRAPH_ENTITY_DECL();
61 
62  protected:
63  static const unsigned int INDEX_LEFT_FOOT_DEFAULT;
64  static const unsigned int INDEX_RIGHT_FOOT_DEFAULT;
65  unsigned int indexLeftFoot, indexRightFoot;
66 
67  static const double TRIGGER_THRESHOLD_DEFAULT;
69 
70  unsigned int lastFoot;
71 
72  public: /* --- CONSTRUCTION --- */
73  WhichFootUpper(const std::string &name);
74  virtual ~WhichFootUpper(void);
75 
76  public: /* --- SIGNAL --- */
77  SignalPtr<MatrixRotation, int> waistRsensorSIN;
78  SignalPtr<MatrixRotation, int> worldRsensorSIN;
79  SignalPtr<MatrixHomogeneous, int> waistMlfootSIN;
80  SignalPtr<MatrixHomogeneous, int> waistMrfootSIN;
81 
82  SignalTimeDependent<MatrixHomogeneous, int> worldMlfootSOUT;
83  SignalTimeDependent<MatrixHomogeneous, int> worldMrfootSOUT;
84  SignalTimeDependent<unsigned int, int> whichFootSOUT;
85 
86  SignalPtr<MatrixHomogeneous, int> waistMsensorSIN;
87  SignalTimeDependent<MatrixRotation, int> waistRsensorSOUT;
88 
89  public: /* --- FUNCTIONS --- */
90  static MatrixHomogeneous &computeFootPosition(
91  const MatrixHomogeneous &waistMfoot, const MatrixRotation &waistRsensor,
92  const MatrixRotation &worldRsensor, MatrixHomogeneous &res);
93 
94  MatrixRotation &computeRotationMatrix(MatrixRotation &rotMat, int time);
95 
96  unsigned int &whichFoot(const MatrixHomogeneous &waistMlfoot,
97  const MatrixHomogeneous &waistMrfoot,
98  unsigned int &res);
99 
100  public: /* --- PARAMS --- */
101  virtual void commandLine(const std::string &cmdLine,
102  std::istringstream &cmdArgs, std::ostream &os);
103 };
104 
105 } // namespace sot
106 } // namespace dynamicgraph
107 
108 #endif // #ifndef __SOT_WhichFootUpper_H__
dynamicgraph::sot::WhichFootUpper::worldRsensorSIN
SignalPtr< MatrixRotation, int > worldRsensorSIN
Definition: which-foot-upper.h:78
dynamicgraph
Definition: exception-pg.h:47
dynamicgraph::sot::WhichFootUpper
Definition: which-foot-upper.h:58
dynamicgraph::sot::WhichFootUpper::waistMrfootSIN
SignalPtr< MatrixHomogeneous, int > waistMrfootSIN
Definition: which-foot-upper.h:80
dynamicgraph::sot::WhichFootUpper::whichFootSOUT
SignalTimeDependent< unsigned int, int > whichFootSOUT
Definition: which-foot-upper.h:84
dynamicgraph::sot::WhichFootUpper::waistRsensorSOUT
SignalTimeDependent< MatrixRotation, int > waistRsensorSOUT
Definition: which-foot-upper.h:87
dynamicgraph::sot::WhichFootUpper::TRIGGER_THRESHOLD_DEFAULT
static const double TRIGGER_THRESHOLD_DEFAULT
Definition: which-foot-upper.h:67
dynamicgraph::sot::WhichFootUpper::indexRightFoot
unsigned int indexRightFoot
Definition: which-foot-upper.h:65
dynamicgraph::sot::WhichFootUpper::triggerThreshold
double triggerThreshold
Definition: which-foot-upper.h:68
dynamicgraph::sot::WhichFootUpper::worldMlfootSOUT
SignalTimeDependent< MatrixHomogeneous, int > worldMlfootSOUT
Definition: which-foot-upper.h:82
dynamicgraph::sot::WhichFootUpper::waistMsensorSIN
SignalPtr< MatrixHomogeneous, int > waistMsensorSIN
Definition: which-foot-upper.h:86
WhichFootUpper_EXPORT
#define WhichFootUpper_EXPORT
Definition: which-foot-upper.h:48
dynamicgraph::sot::WhichFootUpper::INDEX_LEFT_FOOT_DEFAULT
static const unsigned int INDEX_LEFT_FOOT_DEFAULT
Definition: which-foot-upper.h:63
dynamicgraph::sot::WhichFootUpper::INDEX_RIGHT_FOOT_DEFAULT
static const unsigned int INDEX_RIGHT_FOOT_DEFAULT
Definition: which-foot-upper.h:64
dynamicgraph::sot::WhichFootUpper::lastFoot
unsigned int lastFoot
Definition: which-foot-upper.h:70
dynamicgraph::sot::WhichFootUpper::waistMlfootSIN
SignalPtr< MatrixHomogeneous, int > waistMlfootSIN
Definition: which-foot-upper.h:79
dynamicgraph::sot::WhichFootUpper::waistRsensorSIN
SignalPtr< MatrixRotation, int > waistRsensorSIN
Definition: which-foot-upper.h:77
dynamicgraph::sot::WhichFootUpper::worldMrfootSOUT
SignalTimeDependent< MatrixHomogeneous, int > worldMrfootSOUT
Definition: which-foot-upper.h:83