EEROS  1.0.0.0
API for the EEROS Real-Time Robotics Framework
SpaceNavigatorDigIn.hpp
Go to the documentation of this file.
1 #ifndef ORG_EEROS_SPACENAVIGATOR_DIGIN_HPP_
2 #define ORG_EEROS_SPACENAVIGATOR_DIGIN_HPP_
3 
4 #include <eeros/hal/Input.hpp>
6 #include <fstream>
7 #include <string>
8 
9 namespace eeros {
10  namespace hal {
11  class SpaceNavigatorDigIn : public Input<bool> {
12  public:
13  SpaceNavigatorDigIn(std::string id, SpaceNavigator* sn) : Input<bool>(id, nullptr), sn(sn) { }
15  virtual bool get() {
16  if (getId().compare("SpaceNavButtonL") == 0) return sn->current.button[SpaceNav::Button::L];
17  if (getId().compare("SpaceNavButtonR") == 0) return sn->current.button[SpaceNav::Button::R];
18  return false;
19  }
20 
21  private:
22  SpaceNavigator* sn;
23  };
24 
25  };
26 };
27 
28 #endif /* ORG_EEROS_SPACENAVIGATOR_DIGIN_HPP_ */
static constexpr int R
Definition: SpaceNavigator.hpp:35
bool button[SPACENAVIGATOR_BUTTON_COUNT]
Definition: SpaceNavigator.hpp:19
static constexpr int L
Definition: SpaceNavigator.hpp:34
Definition: SpaceNavigator.hpp:39
Definition: Input.hpp:17
Definition: Config.hpp:14
Definition: SpaceNavigatorDigIn.hpp:11
SpaceState current
Definition: SpaceNavigator.hpp:45
virtual std::string getId() const
Definition: Input.hpp:21
~SpaceNavigatorDigIn()
Definition: SpaceNavigatorDigIn.hpp:14
SpaceNavigatorDigIn(std::string id, SpaceNavigator *sn)
Definition: SpaceNavigatorDigIn.hpp:13