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 
35 #include <sot/core/matrix-geometry.hh>
36 
37 /* STD */
38 #include <deque>
39 #include <fstream>
40 #include <string>
41 
42 /* --------------------------------------------------------------------- */
43 /* --- API ------------------------------------------------------------- */
44 /* --------------------------------------------------------------------- */
45 
46 #if defined(WIN32)
47 #if defined(step_computer_joystick_EXPORTS)
48 #define StepComputerJOYSTICK_EXPORT __declspec(dllexport)
49 #else
50 #define StepComputerJOYSTICK_EXPORT __declspec(dllimport)
51 #endif
52 #else
53 #define StepComputerJOYSTICK_EXPORT
54 #endif
55 
56 namespace dynamicgraph {
57 namespace sot {
58 
59 /* --------------------------------------------------------------------- */
60 /* --- CLASS ----------------------------------------------------------- */
61 /* --------------------------------------------------------------------- */
62 
63 class StepQueue;
64 
67  public StepComputer {
68  public:
69  static const std::string CLASS_NAME;
70  virtual const std::string &getClassName(void) const { return CLASS_NAME; }
71 
72  public: // Construction
73  StepComputerJoystick(const std::string &name);
74 
75  public: // Methods
76  void changeFirstStep(StepQueue &queue, int timeCurr);
77  void nextStep(StepQueue &queue, int timeCurr);
78 
79  public: // Signals
81  SignalPtr<Vector, int> joystickSIN;
83  SignalPtr<unsigned, int> contactFootSIN;
85  SignalTimeDependent<Vector, int> laststepSOUT;
86 
87  protected:
88  Vector &getlaststep(Vector &res, int time);
89 
90  public: // Entity
91  virtual void display(std::ostream &os) const;
92  virtual void commandLine(const std::string &cmdLine,
93  std::istringstream &cmdArgs, std::ostream &os);
94 
95  private: // Reference frame
96  StepChecker checker;
97 
98  void thisIsZero();
99 
100  private: // Debug
101  std::ofstream logChanges;
102  std::ofstream logPreview;
103 
104  double m_laststep[3];
105 };
106 
107 } // namespace sot
108 } // namespace dynamicgraph
109 
110 #endif // #ifndef __SOT_STEPCOMPUTER_H__
dynamicgraph::sot::StepComputerJoystick::CLASS_NAME
static const std::string CLASS_NAME
Definition: step-computer-joystick.h:69
dynamicgraph::sot::StepComputerJoystick::laststepSOUT
SignalTimeDependent< Vector, int > laststepSOUT
Externalize the last step .
Definition: step-computer-joystick.h:85
dynamicgraph
Definition: exception-pg.h:47
dynamicgraph::sot::StepComputerJoystick
Generates footsteps.
Definition: step-computer-joystick.h:66
step-checker.h
step-observer.h
StepComputerJOYSTICK_EXPORT
#define StepComputerJOYSTICK_EXPORT
Definition: step-computer-joystick.h:53
dynamicgraph::sot::StepComputerJoystick::getClassName
virtual const std::string & getClassName(void) const
Definition: step-computer-joystick.h:70
dynamicgraph::sot::StepComputer
Generates footsteps.
Definition: step-computer.h:53
dynamicgraph::sot::StepChecker
Definition: step-checker.h:41
step-computer.h
dynamicgraph::sot::StepQueue
A step queue in the preview window.
Definition: step-queue.h:77
dynamicgraph::sot::StepComputerJoystick::joystickSIN
SignalPtr< Vector, int > joystickSIN
Entry of the joystick (x,y,theta)
Definition: step-computer-joystick.h:81
dynamicgraph::sot::StepComputerJoystick::contactFootSIN
SignalPtr< unsigned, int > contactFootSIN
Getting the support foot.
Definition: step-computer-joystick.h:83