Loading...
Searching...
No Matches
step-observer.h
Go to the documentation of this file.
1/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 * Copyright Projet JRL-Japan, 2007
3 *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 *
5 * File: StepComputer.h
6 * Project: SOT
7 * Author: Paul Evrard, Nicolas Mansard
8 *
9 * Version control
10 * ===============
11 *
12 * $Id$
13 *
14 * Description
15 * ============
16 *
17 * Computes reference signals for the stepper.
18 *
19 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
20
21#ifndef __SOT_STEP_OBSERVER_H__
22#define __SOT_STEP_OBSERVER_H__
23
24/* --------------------------------------------------------------------- */
25/* --- INCLUDE --------------------------------------------------------- */
26/* --------------------------------------------------------------------- */
27
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/* --------------------------------------------------------------------- */
34/* --- API ------------------------------------------------------------- */
35/* --------------------------------------------------------------------- */
36
37#if defined(WIN32)
38#if defined(step_observer_EXPORTS)
39#define StepObserver_EXPORT __declspec(dllexport)
40#else
41#define StepObserver_EXPORT __declspec(dllimport)
42#endif
43#else
44#define StepObserver_EXPORT
45#endif
46
47namespace dynamicgraph {
48namespace sot {
49
50/* --------------------------------------------------------------------- */
51/* --- CLASS ----------------------------------------------------------- */
52/* --------------------------------------------------------------------- */
53
58class StepObserver_EXPORT StepObserver : public Entity {
59 public:
60 static const std::string CLASS_NAME;
61 virtual const std::string &getClassName(void) const { return CLASS_NAME; }
62
63 public:
64 SignalPtr<MatrixHomogeneous, int> leftHandPositionSIN;
65 SignalPtr<MatrixHomogeneous, int> rightHandPositionSIN;
66
67 SignalPtr<MatrixHomogeneous, int> leftFootPositionSIN;
68 SignalPtr<MatrixHomogeneous, int> rightFootPositionSIN;
69 SignalPtr<MatrixHomogeneous, int> waistPositionSIN;
70
72 SignalTimeDependent<MatrixHomogeneous, int> referencePositionLeftSOUT;
73
75 SignalTimeDependent<MatrixHomogeneous, int> referencePositionRightSOUT;
76
78 SignalTimeDependent<MatrixHomogeneous, int> referencePositionWaistSOUT;
79
80 public: // methods
81 StepObserver(const std::string &name);
82
83 SignalArray<int> getSignals(void);
84 operator SignalArray<int>();
85
86 public: // signal callbacks
87 MatrixHomogeneous &computeReferencePositionLeft(MatrixHomogeneous &res,
88 int timeCurr);
89 MatrixHomogeneous &computeReferencePositionRight(MatrixHomogeneous &res,
90 int timeCurr);
91 MatrixHomogeneous &computeReferencePositionWaist(MatrixHomogeneous &res,
92 int timeCurr);
93
94 public: // Entity
95 virtual void display(std::ostream &os) const;
96 virtual void commandLine(const std::string &cmdLine,
97 std::istringstream &cmdArgs, std::ostream &os);
98
99 private: // helpers
100 MatrixHomogeneous &computeRefPos(MatrixHomogeneous &res, int timeCurr,
101 const MatrixHomogeneous &wMref);
102};
103
104} // namespace sot
105} // namespace dynamicgraph
106
107#endif
Definition: step-observer.h:58
virtual void display(std::ostream &os) const
MatrixHomogeneous & computeReferencePositionWaist(MatrixHomogeneous &res, int timeCurr)
SignalTimeDependent< MatrixHomogeneous, int > referencePositionWaistSOUT
Reference frame in the waist coordinates.
Definition: step-observer.h:78
SignalTimeDependent< MatrixHomogeneous, int > referencePositionLeftSOUT
Reference frame in left foot coordinates.
Definition: step-observer.h:72
SignalTimeDependent< MatrixHomogeneous, int > referencePositionRightSOUT
Reference frame in right foot coordinates.
Definition: step-observer.h:75
SignalPtr< MatrixHomogeneous, int > rightFootPositionSIN
Definition: step-observer.h:68
MatrixHomogeneous & computeReferencePositionLeft(MatrixHomogeneous &res, int timeCurr)
SignalPtr< MatrixHomogeneous, int > leftHandPositionSIN
Definition: step-observer.h:64
SignalPtr< MatrixHomogeneous, int > waistPositionSIN
Definition: step-observer.h:69
static const std::string CLASS_NAME
Definition: step-observer.h:60
SignalPtr< MatrixHomogeneous, int > rightHandPositionSIN
Definition: step-observer.h:65
virtual void commandLine(const std::string &cmdLine, std::istringstream &cmdArgs, std::ostream &os)
MatrixHomogeneous & computeReferencePositionRight(MatrixHomogeneous &res, int timeCurr)
StepObserver(const std::string &name)
virtual const std::string & getClassName(void) const
Definition: step-observer.h:61
SignalArray< int > getSignals(void)
SignalPtr< MatrixHomogeneous, int > leftFootPositionSIN
Definition: step-observer.h:67
Definition: exception-pg.h:47
#define StepObserver_EXPORT
Definition: step-observer.h:44