step-time-line.h
Go to the documentation of this file.
1 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2  * Copyright Projet JRL-Japan, 2007
3  *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4  *
5  * File: StepTimeLine.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  * StepTimeLine entity: synchronizes a StepQueue, a StepComputer and a
18  * PGManager to compute steps to send to the PG. Uses a StepChecker
19  * to clip the steps.
20  * Highest-level class for automatic step generation.
21  *
22  * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
23 
24 #ifndef __SOT_STEP_TIME_LINE_H__
25 #define __SOT_STEP_TIME_LINE_H__
26 
27 /* --------------------------------------------------------------------- */
28 /* --- INCLUDE --------------------------------------------------------- */
29 /* --------------------------------------------------------------------- */
30 
31 #include <pinocchio/fwd.hpp>
32 
33 /* SOT */
34 #include <dynamic-graph/entity.h>
35 #include <dynamic-graph/signal-ptr.h>
36 #include <dynamic-graph/signal-time-dependent.h>
40 
41 /* --------------------------------------------------------------------- */
42 /* --- API ------------------------------------------------------------- */
43 /* --------------------------------------------------------------------- */
44 
45 #if defined(WIN32)
46 #if defined(step_time_line_EXPORTS)
47 #define StepTimeLine_EXPORT __declspec(dllexport)
48 #else
49 #define StepTimeLine_EXPORT __declspec(dllimport)
50 #endif
51 #else
52 #define StepTimeLine_EXPORT
53 #endif
54 
55 namespace dynamicgraph {
56 namespace sot {
57 
58 /* --------------------------------------------------------------------- */
59 /* --- CLASS ----------------------------------------------------------- */
60 /* --------------------------------------------------------------------- */
61 
82 class StepTimeLine_EXPORT StepTimeLine : public Entity {
83  public: // Entity name
84  static const std::string CLASS_NAME;
85  virtual const std::string &getClassName(void) const { return CLASS_NAME; }
86 
87  private:
88  static const unsigned int PERIOD_DEFAULT;
89 
92  static const unsigned int FIRST_STEP_TO_MODIFY;
93 
94  public: // Construction
95  StepTimeLine(const std::string &name);
96 
97  public: // Trigger
101  Signal<int, int> triggerSOUT;
102 
105  int &triggerCall(int &dummy, int timeCurr);
106 
107  private: // State
108  enum SteppingState {
109  STATE_STARTING,
110  STATE_STOPPING,
111  STATE_STARTED,
113  STATE_STOPPED
114  };
115 
116  public: // Entity
117  virtual void display(std::ostream &os) const;
118  virtual void commandLine(const std::string &cmdLine,
119  std::istringstream &cmdArgs, std::ostream &os);
120 
121  private:
122  StepQueue *stepQueue;
123  StepComputer *stepComputer;
124  PGManager *pgManager;
125 
126  SteppingState state;
127  int timeLastIntroduction;
128  int period;
129  unsigned int nStartingSteps;
130 };
131 
132 } // namespace sot
133 } // namespace dynamicgraph
134 
135 #endif
dynamicgraph
Definition: exception-pg.h:47
dynamicgraph::sot::StepTimeLine::CLASS_NAME
static const std::string CLASS_NAME
Definition: step-time-line.h:84
dynamicgraph::sot::StepTimeLine::getClassName
virtual const std::string & getClassName(void) const
Definition: step-time-line.h:85
dynamicgraph::sot::StepComputer
Generates footsteps.
Definition: step-computer.h:53
dynamicgraph::sot::StepTimeLine
Definition: step-time-line.h:82
dynamicgraph::sot::StepTimeLine::triggerSOUT
Signal< int, int > triggerSOUT
Definition: step-time-line.h:101
pg-manager.h
step-computer.h
dynamicgraph::sot::PGManager
Finds the PG and sends steps to the PG.
Definition: pg-manager.h:65
dynamicgraph::sot::StepQueue
A step queue in the preview window.
Definition: step-queue.h:77
StepTimeLine_EXPORT
#define StepTimeLine_EXPORT
Definition: step-time-line.h:52
step-queue.h