Loading...
Searching...
No Matches
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
55namespace dynamicgraph {
56namespace sot {
57
58/* --------------------------------------------------------------------- */
59/* --- CLASS ----------------------------------------------------------- */
60/* --------------------------------------------------------------------- */
61
82class 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,
112 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
Finds the PG and sends steps to the PG.
Definition pg-manager.h:65
Generates footsteps.
Definition step-computer.h:53
A step queue in the preview window.
Definition step-queue.h:77
Definition step-time-line.h:82
virtual const std::string & getClassName(void) const
Definition step-time-line.h:85
int & triggerCall(int &dummy, int timeCurr)
StepTimeLine(const std::string &name)
static const std::string CLASS_NAME
Definition step-time-line.h:84
virtual void commandLine(const std::string &cmdLine, std::istringstream &cmdArgs, std::ostream &os)
virtual void display(std::ostream &os) const
Signal< int, int > triggerSOUT
Definition step-time-line.h:101
Definition exception-pg.h:47
#define StepTimeLine_EXPORT
Definition step-time-line.h:52