Loading...
Searching...
No Matches
step-queue.h
Go to the documentation of this file.
1/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 * Copyright Projet JRL-Japan, 2007
3 *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 *
5 * File: StepQueue.h
6 * Project: SOT
7 * Author: Paul Evrard, Nicolas Mansard
8 *
9 * Version control
10 * ===============
11 *
12 * $Id$
13 *
14 * Description
15 * ============
16 *
17 * StepQueue entity: manages a step queue (a series of future steps,
18 * plus a series of changes in the future steps).
19 *
20 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
21
22#ifndef __SOT_STEPQUEUE_H__
23#define __SOT_STEPQUEUE_H__
24
25/* --------------------------------------------------------------------- */
26/* --- INCLUDE --------------------------------------------------------- */
27/* --------------------------------------------------------------------- */
28
29/* SOT */
30#include <dynamic-graph/entity.h>
31
32/* STD */
33#include <deque>
34#include <string>
35
36namespace dynamicgraph {
37namespace sot {
38
39/* --------------------------------------------------------------------- */
40/* --- API ------------------------------------------------------------- */
41/* --------------------------------------------------------------------- */
42
43#if defined(WIN32)
44#if defined(step_queue_EXPORTS)
45#define StepQueue_EXPORT __declspec(dllexport)
46#else
47#define StepQueue_EXPORT __declspec(dllimport)
48#endif
49#else
50#define StepQueue_EXPORT
51#endif
52
53/* --------------------------------------------------------------------- */
54/* --- CLASS ----------------------------------------------------------- */
55/* --------------------------------------------------------------------- */
56
59
61 public:
63 FootPrint(double x, double y, double theta, ContactName contact);
64
65 double x, y, theta;
68};
69
71
77class StepQueue_EXPORT StepQueue : public Entity {
78 public: // Entity name
79 static const std::string CLASS_NAME;
80 virtual const std::string &getClassName(void) const { return CLASS_NAME; }
81
82 private: // Parameters
83 static const unsigned int QUEUE_SIZE;
84 static const double ZERO_STEP_POSITION;
85 static const FootPrint START_FOOT_PRINT;
86
87 public: // Construction
91 StepQueue(const std::string &name);
92
93 public: // Queue manipulation
97
101 void pushStep(double x, double y, double theta);
102
104
106 const FootPrint &getStep(unsigned int index) const;
107 const FootPrint &getFirstStep() const;
108 const FootPrint &getLastStep() const;
110
112 void changeFirstStep(double x, double y, double dtheta);
113
115
118 bool isFirstStepChanged() const;
119
120 public: // Queue properties
122
123 unsigned int size() const;
125 double getZeroStepPosition() const;
127
128 public: // Entity
129 virtual void display(std::ostream &os) const;
130 virtual void commandLine(const std::string &cmdLine,
131 std::istringstream &cmdArgs, std::ostream &os);
132
133 private:
134 std::deque<FootPrint> footPrintList;
135 FootPrint firstStepChange;
136 bool firstStepChanged;
137};
138
139} // namespace sot
140} // namespace dynamicgraph
141
142#endif
Definition step-queue.h:60
ContactName contact
Fly foot.
Definition step-queue.h:67
double theta
Definition step-queue.h:65
FootPrint(double x, double y, double theta, ContactName contact)
A step queue in the preview window.
Definition step-queue.h:77
void changeFirstStep(double x, double y, double dtheta)
Changes the first step.
virtual void commandLine(const std::string &cmdLine, std::istringstream &cmdArgs, std::ostream &os)
const FootPrint & getStep(unsigned int index) const
void pushStep(double x, double y, double theta)
virtual const std::string & getClassName(void) const
Definition step-queue.h:80
StepQueue(const std::string &name)
const FootPrint & getStartFootPrint() const
virtual void display(std::ostream &os) const
const FootPrint & getLastStep() const
double getZeroStepPosition() const
const FootPrint & getFirstStep() const
const FootPrint & getFirstStepChange() const
unsigned int size() const
Access to the step queue properties (constants).
static const std::string CLASS_NAME
Definition step-queue.h:79
ContactName
Support foot identifier.
Definition step-queue.h:58
@ CONTACT_LEFT_FOOT
Definition step-queue.h:58
@ CONTACT_RIGHT_FOOT
Definition step-queue.h:58
Definition exception-pg.h:47
#define StepQueue_EXPORT
Definition step-queue.h:50