step-computer-joystick.h
Go to the documentation of this file.
1 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2  * Copyright Projet JRL-Japan, 2007
3  *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4  *
5  * File: StepComputer.h
6  * Project: SOT
7  * Author: Olivier Stasse
8  *
9  * Version control
10  * ===============
11  *
12  * $Id$
13  *
14  * Description
15  * ============
16  *
17  *
18  * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
19 
20 #ifndef __SOT_StepComputer_JOYSTICK_H__
21 #define __SOT_StepComputer_JOYSTICK_H__
22 
23 /* --------------------------------------------------------------------- */
24 /* --- INCLUDE --------------------------------------------------------- */
25 /* --------------------------------------------------------------------- */
26 
27 /* SOT */
28 #include <dynamic-graph/entity.h>
29 #include <dynamic-graph/signal-ptr.h>
30 #include <dynamic-graph/signal-time-dependent.h>
34 #include <sot/core/matrix-geometry.hh>
35 
36 /* STD */
37 #include <deque>
38 #include <fstream>
39 #include <string>
40 
41 /* --------------------------------------------------------------------- */
42 /* --- API ------------------------------------------------------------- */
43 /* --------------------------------------------------------------------- */
44 
45 #if defined(WIN32)
46 #if defined(step_computer_joystick_EXPORTS)
47 #define StepComputerJOYSTICK_EXPORT __declspec(dllexport)
48 #else
49 #define StepComputerJOYSTICK_EXPORT __declspec(dllimport)
50 #endif
51 #else
52 #define StepComputerJOYSTICK_EXPORT
53 #endif
54 
55 namespace dynamicgraph {
56 namespace sot {
57 
58 /* --------------------------------------------------------------------- */
59 /* --- CLASS ----------------------------------------------------------- */
60 /* --------------------------------------------------------------------- */
61 
62 class StepQueue;
63 
66  public StepComputer {
67  public:
68  static const std::string CLASS_NAME;
69  virtual const std::string &getClassName(void) const { return CLASS_NAME; }
70 
71  public: // Construction
72  StepComputerJoystick(const std::string &name);
73 
74  public: // Methods
75  void changeFirstStep(StepQueue &queue, int timeCurr);
76  void nextStep(StepQueue &queue, int timeCurr);
77 
78  public: // Signals
80  SignalPtr<Vector, int> joystickSIN;
82  SignalPtr<unsigned, int> contactFootSIN;
84  SignalTimeDependent<Vector, int> laststepSOUT;
85 
86  protected:
87  Vector &getlaststep(Vector &res, int time);
88 
89  public: // Entity
90  virtual void display(std::ostream &os) const;
91  virtual void commandLine(const std::string &cmdLine,
92  std::istringstream &cmdArgs, std::ostream &os);
93 
94  private: // Reference frame
95  StepChecker checker;
96 
97  void thisIsZero();
98 
99  private: // Debug
100  std::ofstream logChanges;
101  std::ofstream logPreview;
102 
103  double m_laststep[3];
104 };
105 
106 } // namespace sot
107 } // namespace dynamicgraph
108 
109 #endif // #ifndef __SOT_STEPCOMPUTER_H__
SignalPtr< unsigned, int > contactFootSIN
Getting the support foot.
Definition: step-computer-joystick.h:82
SignalTimeDependent< Vector, int > laststepSOUT
Externalize the last step .
Definition: step-computer-joystick.h:84
Definition: step-checker.h:41
Generates footsteps.
Definition: step-computer.h:52
virtual const std::string & getClassName(void) const
Definition: step-computer-joystick.h:69
#define StepComputerJOYSTICK_EXPORT
Definition: step-computer-joystick.h:52
Generates footsteps.
Definition: step-computer-joystick.h:65
A step queue in the preview window.
Definition: step-queue.h:77
static const std::string CLASS_NAME
Definition: step-computer-joystick.h:68
SignalPtr< Vector, int > joystickSIN
Entry of the joystick (x,y,theta)
Definition: step-computer-joystick.h:80
Definition: exception-pg.h:47