EEROS  1.0.0.0
API for the EEROS Real-Time Robotics Framework
SpaceNavigator.hpp
Go to the documentation of this file.
1 #ifndef ORG_EEROS_HAL_SPACENAVIGATOR_HPP_
2 #define ORG_EEROS_HAL_SPACENAVIGATOR_HPP_
3 
4 #include <string>
5 #include <functional>
6 #include <eeros/hal/Input.hpp>
7 #include <eeros/core/Thread.hpp>
9 
10 #define SPACENAVIGATOR_AXIS_COUNT (3)
11 #define SPACENAVIGATOR_ROT_AXIS_COUNT (3)
12 #define SPACENAVIGATOR_BUTTON_COUNT (2)
13 
14 namespace eeros {
15  namespace hal {
16  struct SpaceState {
20  };
21 
22  struct SpaceNav {
23  struct Axis {
24  static constexpr int X = 0;
25  static constexpr int Y = 1;
26  static constexpr int Z = 2;
27  };
28  struct RotAxis {
29  static constexpr int RX = 0;
30  static constexpr int RY = 1;
31  static constexpr int RZ = 2;
32  };
33  struct Button {
34  static constexpr int L = 0;
35  static constexpr int R = 1;
36  };
37  };
38 
39  class SpaceNavigator : public eeros::Thread {
40  public:
41  explicit SpaceNavigator(std::string dev);
42  ~SpaceNavigator();
43  virtual std::string name();
44 
46 
47  private:
48  virtual void run();
49  virtual bool open(const char* device);
50  virtual void close();
51  FILE* file;
52  bool running, useRaw;
55  };
56  }
57 }
58 
59 #endif // ORG_EEROS_HAL_SPACENAVIGATOR_HPP_
#define SPACENAVIGATOR_ROT_AXIS_COUNT
Definition: SpaceNavigator.hpp:11
Definition: Logger.hpp:15
Definition: SpaceNavigator.hpp:28
#define SPACENAVIGATOR_AXIS_COUNT
Definition: SpaceNavigator.hpp:10
bool button[SPACENAVIGATOR_BUTTON_COUNT]
Definition: SpaceNavigator.hpp:19
Definition: SpaceNavigator.hpp:23
Definition: SpaceNavigator.hpp:39
Definition: Config.hpp:14
double axis[SPACENAVIGATOR_AXIS_COUNT]
Definition: SpaceNavigator.hpp:17
Definition: SpaceNavigator.hpp:22
double rotAxis[SPACENAVIGATOR_ROT_AXIS_COUNT]
Definition: SpaceNavigator.hpp:18
Definition: Thread.hpp:12
Definition: SpaceNavigator.hpp:33
#define SPACENAVIGATOR_BUTTON_COUNT
Definition: SpaceNavigator.hpp:12
volatile bool running
Definition: Executor.cpp:25
SpaceState current
Definition: SpaceNavigator.hpp:45
Definition: SpaceNavigator.hpp:16