Galaxis Codebase  1.0.0
Team Galaxis software stack for the Carolo Cup 2023 - ROS2 based software
ServiceState.hpp
Go to the documentation of this file.
1 #ifndef SERVICE_STATE_HPP_
2 #define SERVICE_STATE_HPP_
3 
4 #include <map>
5 #include <string>
6 
7 namespace galaxis {
8  namespace serviceStates {
9  enum State {
15  };
16 
17  typedef enum {
18  BTN_SC1 = 1,
19  BTN_SC2 = 1 << 1,
20  BTN_SC3 = 1 << 2,
21  } ButtonType;
22 
23  typedef enum {
24  LED_SC1 = 1,
25  LED_SC2 = 1 << 1,
26  LED_SC3 = 1 << 2,
27  } LedType;
28 
29  static std::map<State, std::string> stateMap = {
30  { BOOTSTRAP, "bootstrap" },
31  { TRAINING, "training" },
32  { FREE_DRIVING, "free_driving" },
33  { OBSTACLE_DRIVING, "obstacle_driving" },
34  };
35 
36  static std::map<ButtonType, State> btnStateMap = {
37  { BTN_SC1, TRAINING },
38  { BTN_SC2, FREE_DRIVING },
40  };
41 
42  static std::map<State, LedType> stateLedMap = {
43  { TRAINING, LED_SC1 },
44  { FREE_DRIVING, LED_SC2 },
46  };
47  } // namespace serviceStates
48 } // namespace galaxis
49 
50 #endif // !SERVICE_STATE_HPP_
galaxis::serviceStates::OBSTACLE_DRIVING
@ OBSTACLE_DRIVING
Definition: ServiceState.hpp:13
galaxis::serviceStates::stateLedMap
static std::map< State, LedType > stateLedMap
Definition: ServiceState.hpp:42
galaxis::serviceStates::COUNT
@ COUNT
Definition: ServiceState.hpp:14
galaxis::serviceStates::stateMap
static std::map< State, std::string > stateMap
Definition: ServiceState.hpp:29
galaxis::serviceStates::TRAINING
@ TRAINING
Definition: ServiceState.hpp:11
galaxis::serviceStates::BOOTSTRAP
@ BOOTSTRAP
Definition: ServiceState.hpp:10
galaxis::serviceStates::LED_SC1
@ LED_SC1
Definition: ServiceState.hpp:24
galaxis::serviceStates::BTN_SC3
@ BTN_SC3
Definition: ServiceState.hpp:20
galaxis::serviceStates::ButtonType
ButtonType
Definition: ServiceState.hpp:17
galaxis::serviceStates::BTN_SC1
@ BTN_SC1
Definition: ServiceState.hpp:18
galaxis
Definition: MapClasses.hpp:10
galaxis::serviceStates::LedType
LedType
Definition: ServiceState.hpp:23
galaxis::serviceStates::btnStateMap
static std::map< ButtonType, State > btnStateMap
Definition: ServiceState.hpp:36
galaxis::serviceStates::LED_SC2
@ LED_SC2
Definition: ServiceState.hpp:25
galaxis::serviceStates::LED_SC3
@ LED_SC3
Definition: ServiceState.hpp:26
galaxis::serviceStates::FREE_DRIVING
@ FREE_DRIVING
Definition: ServiceState.hpp:12
galaxis::serviceStates::BTN_SC2
@ BTN_SC2
Definition: ServiceState.hpp:19
galaxis::serviceStates::State
State
Definition: ServiceState.hpp:9