com-freezer.hh
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_SOTCOMFREEZER_H_H
11 #define __SOT_SOTCOMFREEZER_H_H
12 
13 /* --------------------------------------------------------------------- */
14 /* --- INCLUDE --------------------------------------------------------- */
15 /* --------------------------------------------------------------------- */
16 
17 /* Matrix */
18 #include <dynamic-graph/linear-algebra.h>
19 namespace dg = dynamicgraph;
20 
21 /* SOT */
22 #include <dynamic-graph/all-signals.h>
23 #include <dynamic-graph/entity.h>
24 
25 /* --------------------------------------------------------------------- */
26 /* --- API ------------------------------------------------------------- */
27 /* --------------------------------------------------------------------- */
28 
29 #if defined(WIN32)
30 #if defined(com_freezer_EXPORTS)
31 #define SOTCOMFREEZER_EXPORT __declspec(dllexport)
32 #else
33 #define SOTCOMFREEZER_EXPORT __declspec(dllimport)
34 #endif
35 #else
36 #define SOTCOMFREEZER_EXPORT
37 #endif
38 
39 namespace dynamicgraph {
40 namespace sot {
41 
42 namespace dg = dynamicgraph;
43 
44 /* --------------------------------------------------------------------- */
45 /* --- CLASS ----------------------------------------------------------- */
46 /* --------------------------------------------------------------------- */
47 
48 class SOTCOMFREEZER_EXPORT CoMFreezer : public dg::Entity {
49 public:
50  static const std::string CLASS_NAME;
51  virtual const std::string &getClassName() const { return CLASS_NAME; }
52 
53 private:
54  dg::Vector m_lastCoM;
55  bool m_previousPGInProcess;
56  int m_lastStopTime;
57 
58 public: /* --- CONSTRUCTION --- */
59  CoMFreezer(const std::string &name);
60  virtual ~CoMFreezer(void);
61 
62 public: /* --- SIGNAL --- */
63  dg::SignalPtr<dg::Vector, int> CoMRefSIN;
64  dg::SignalPtr<unsigned, int> PGInProcessSIN;
65  dg::SignalTimeDependent<dg::Vector, int> freezedCoMSOUT;
66 
67 public: /* --- FUNCTION --- */
68  dg::Vector &computeFreezedCoM(dg::Vector &freezedCoM, const int &time);
69 
70 public: /* --- PARAMS --- */
71  virtual void display(std::ostream &os) const;
72 };
73 
74 } /* namespace sot */
75 } /* namespace dynamicgraph */
76 
77 #endif /* #ifndef __SOT_SOTCOMFREEZER_H_H */
dynamicgraph
Definition: abstract-sot-external-interface.hh:17
dynamicgraph::sot::CoMFreezer
Definition: com-freezer.hh:48
dynamicgraph::sot::CoMFreezer::getClassName
virtual const std::string & getClassName() const
Definition: com-freezer.hh:51
dynamicgraph::sot::CoMFreezer::PGInProcessSIN
dg::SignalPtr< unsigned, int > PGInProcessSIN
Definition: com-freezer.hh:64
dynamicgraph::sot::CoMFreezer::freezedCoMSOUT
dg::SignalTimeDependent< dg::Vector, int > freezedCoMSOUT
Definition: com-freezer.hh:65
SOTCOMFREEZER_EXPORT
#define SOTCOMFREEZER_EXPORT
Definition: com-freezer.hh:36
dynamicgraph::sot::CoMFreezer::CLASS_NAME
static const std::string CLASS_NAME
Definition: com-freezer.hh:50
dynamicgraph::sot::CoMFreezer::CoMRefSIN
dg::SignalPtr< dg::Vector, int > CoMRefSIN
Definition: com-freezer.hh:63