diagnostics.hpp
Go to the documentation of this file.
1 
9 /*****************************************************************************
10 ** Ifdefs
11 *****************************************************************************/
12 
13 #ifndef KOBUKI_NODE_DIAGNOSTICS_HPP_
14 #define KOBUKI_NODE_DIAGNOSTICS_HPP_
15 
16 /*****************************************************************************
17 ** Includes
18 *****************************************************************************/
19 
24 
25 /*****************************************************************************
26 ** Namespaces
27 *****************************************************************************/
28 
29 namespace kobuki {
30 
31 /*****************************************************************************
32 ** Interfaces
33 *****************************************************************************/
34 
35 
40 public:
41  BatteryTask() : DiagnosticTask("Battery") {}
43  void update(const Battery &battery) { status = battery; }
44 
45 private:
47 };
48 
53 public:
54  WatchdogTask() : DiagnosticTask("Watchdog"), alive(false) {}
56  void update(const bool &is_alive) { alive = is_alive; }
57  bool isAlive() const { return alive; }
58 
59 private:
60  bool alive;
61 };
62 
67 public:
68  CliffSensorTask() : DiagnosticTask("Cliff Sensor") {}
70  void update(const uint8_t &new_status, const Cliff::Data &new_values) {
71  status = new_status; values = new_values;
72  }
73 
74 private:
75  uint8_t status;
77 };
78 
83 public:
84  WallSensorTask() : DiagnosticTask("Wall Sensor") {}
86  void update(const uint8_t &new_status) { status = new_status; }
87 
88 private:
89  uint8_t status;
90 };
91 
96 public:
97  WheelDropTask() : DiagnosticTask("Wheel Drop") {}
99  void update(const uint8_t &new_status) { status = new_status; }
100 
101 private:
102  uint8_t status;
103 };
104 
110 public:
111  MotorCurrentTask() : DiagnosticTask("Motor Current") {}
113  void update(const std::vector<uint8_t> &new_values) { values = new_values; }
114 
115 private:
116  std::vector<uint8_t> values;
117 };
118 
123 public:
124  MotorStateTask() : DiagnosticTask("Motor State") {}
126  void update(bool new_state) { state = new_state; };
127 
128 private:
129  bool state;
130 };
131 
136 public:
137  GyroSensorTask() : DiagnosticTask("Gyro Sensor") {}
139  void update(int16_t new_heading) { heading = new_heading; }
140 
141 private:
142  int16_t heading;
143 };
144 
149 public:
150  DigitalInputTask() : DiagnosticTask("Digital Input") {}
152  void update(uint16_t new_status) { status = new_status; }
153 
154 private:
155  uint16_t status;
156 };
157 
162 public:
163  AnalogInputTask() : DiagnosticTask("Analog Input") {}
165  void update(const std::vector<uint16_t> &new_values) { values = new_values; }
166 
167 private:
168  std::vector<uint16_t> values;
169 };
170 
171 } // namespace kobuki
172 
173 #endif /* KOBUKI_NODE_DIAGNOSTICS_HPP_ */
bool isAlive() const
Definition: diagnostics.hpp:57
void update(const std::vector< uint16_t > &new_values)
void run(diagnostic_updater::DiagnosticStatusWrapper &stat)
Definition: diagnostics.cpp:25
void update(uint16_t new_status)
std::vector< double > values
void update(const bool &is_alive)
Definition: diagnostics.hpp:56
void update(bool new_state)
void update(const uint8_t &new_status)
Definition: diagnostics.hpp:99
void update(const uint8_t &new_status)
Definition: diagnostics.hpp:86
void update(const Battery &battery)
Definition: diagnostics.hpp:43
void update(const std::vector< uint8_t > &new_values)
DiagnosticTask(const std::string name)
std::vector< uint16_t > values
void update(int16_t new_heading)
std::vector< uint8_t > values
void update(const uint8_t &new_status, const Cliff::Data &new_values)
Definition: diagnostics.hpp:70


kobuki_node
Author(s): Daniel Stonier, Younghun Ju, Jorge Santos Simon
autogenerated on Mon Jun 10 2019 13:45:13