1 |
|
|
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2 |
|
|
* Copyright Projet JRL-Japan, 2007 |
3 |
|
|
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
4 |
|
|
* |
5 |
|
|
* File: PGManager.h |
6 |
|
|
* Project: SOT |
7 |
|
|
* Author: Nicolas Mansard, Olivier Stasse, Paul Evrard |
8 |
|
|
* |
9 |
|
|
* Version control |
10 |
|
|
* =============== |
11 |
|
|
* |
12 |
|
|
* $Id$ |
13 |
|
|
* |
14 |
|
|
* Description |
15 |
|
|
* ============ |
16 |
|
|
* |
17 |
|
|
* PGManager entity: configures the PG and sends steps. |
18 |
|
|
* |
19 |
|
|
* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ |
20 |
|
|
|
21 |
|
|
#ifndef __SOT_PG_MANAGER_H__ |
22 |
|
|
#define __SOT_PG_MANAGER_H__ |
23 |
|
|
|
24 |
|
|
/* --------------------------------------------------------------------- */ |
25 |
|
|
/* --- INCLUDE --------------------------------------------------------- */ |
26 |
|
|
/* --------------------------------------------------------------------- */ |
27 |
|
|
|
28 |
|
|
#include <pinocchio/fwd.hpp> |
29 |
|
|
|
30 |
|
|
/* Matrix */ |
31 |
|
|
#include <Eigen/Dense> |
32 |
|
|
|
33 |
|
|
/* SOT */ |
34 |
|
|
#include <dynamic-graph/entity.h> |
35 |
|
|
#include <dynamic-graph/signal-ptr.h> |
36 |
|
|
#include <dynamic-graph/signal-time-dependent.h> |
37 |
|
|
#include <sot/pattern-generator/pg.h> |
38 |
|
|
#include <sot/pattern-generator/step-queue.h> |
39 |
|
|
|
40 |
|
|
/* --------------------------------------------------------------------- */ |
41 |
|
|
/* --- API ------------------------------------------------------------- */ |
42 |
|
|
/* --------------------------------------------------------------------- */ |
43 |
|
|
|
44 |
|
|
#if defined(WIN32) |
45 |
|
|
#if defined(pg_manager_EXPORTS) |
46 |
|
|
#define PGManager_EXPORT __declspec(dllexport) |
47 |
|
|
#else |
48 |
|
|
#define PGManager_EXPORT __declspec(dllimport) |
49 |
|
|
#endif |
50 |
|
|
#else |
51 |
|
|
#define PGManager_EXPORT |
52 |
|
|
#endif |
53 |
|
|
|
54 |
|
|
namespace dynamicgraph { |
55 |
|
|
namespace sot { |
56 |
|
|
|
57 |
|
|
/* --------------------------------------------------------------------- */ |
58 |
|
|
/* --- CLASS ----------------------------------------------------------- */ |
59 |
|
|
/* --------------------------------------------------------------------- */ |
60 |
|
|
|
61 |
|
|
class StepQueue; |
62 |
|
|
class PatternGenerator; |
63 |
|
|
|
64 |
|
|
/// Finds the PG and sends steps to the PG. |
65 |
|
|
class PGManager_EXPORT PGManager : public Entity { |
66 |
|
|
public: // Entity name |
67 |
|
|
DYNAMIC_GRAPH_ENTITY_DECL(); |
68 |
|
|
|
69 |
|
|
public: // Construction |
70 |
|
|
PGManager(const std::string &name); |
71 |
|
|
|
72 |
|
|
void startSequence(const StepQueue &seq); |
73 |
|
|
void stopSequence(const StepQueue &seq); |
74 |
|
|
void introduceStep(StepQueue &queue); |
75 |
|
|
double changeNextStep(StepQueue &queue); |
76 |
|
|
|
77 |
|
|
public: // Entity |
78 |
|
|
virtual void display(std::ostream &os) const; |
79 |
|
|
virtual void commandLine(const std::string &cmdLine, |
80 |
|
|
std::istringstream &cmdArgs, std::ostream &os); |
81 |
|
|
|
82 |
|
|
private: |
83 |
|
|
std::vector<FootPrint> stepbuf_; |
84 |
|
|
PatternGenerator *spg_; |
85 |
|
|
PatternGeneratorJRL::PatternGeneratorInterface *pgi_; |
86 |
|
|
}; |
87 |
|
|
|
88 |
|
|
} // namespace sot |
89 |
|
|
} // namespace dynamicgraph |
90 |
|
|
|
91 |
|
|
#endif |