diagnostics_1.hpp
Go to the documentation of this file.
1 
9 /*****************************************************************************
10 ** Ifdefs
11 *****************************************************************************/
12 
13 #ifndef XBOT_NODE_DIAGNOSTICS_HPP_
14 #define XBOT_NODE_DIAGNOSTICS_HPP_
15 
16 /*****************************************************************************
17 ** Includes
18 *****************************************************************************/
19 
20 //#include <xbot_driver/packets/cliff.hpp>
21 #include <xbot_driver/modules/battery.hpp>
24 
25 /*****************************************************************************
26 ** Namespaces
27 *****************************************************************************/
28 
29 namespace xbot {
30 
31 /*****************************************************************************
32 ** Interfaces
33 *****************************************************************************/
34 
35 
40 public:
41  BatteryTask() : DiagnosticTask("Battery") {}
43  void update(const Battery &battery) { status = battery; }
44 
45 private:
46  Battery status;
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:
76  Cliff::Data values;
77 };
78 
83 public:
84  WallSensorTask() : DiagnosticTask("Wall Sensor") {}
86  void update(const uint8_t &new_status) { status = new_status; }
87 
88 private:
90 };
91 
96 public:
97  WheelDropTask() : DiagnosticTask("Wheel Drop") {}
99  void update(const uint8_t &new_status) { status = new_status; }
100 
101 private:
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:
143 };
144 
149 public:
150  DigitalInputTask() : DiagnosticTask("Digital Input") {}
152  void update(uint16_t new_status) { status = new_status; }
153 
154 private:
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 xbot
172 
173 #endif /* XBOT_NODE_DIAGNOSTICS_HPP_ */
void update(bool new_state)
std::vector< uint16_t > values
std::vector< double > values
void run(diagnostic_updater::DiagnosticStatusWrapper &stat)
void update(int16_t new_heading)
bool isAlive() const
void update(const uint8_t &new_status)
unsigned short uint16_t
unsigned char uint8_t
void update(uint16_t new_status)
void update(const std::vector< uint16_t > &new_values)
void update(const uint8_t &new_status, const Cliff::Data &new_values)
void update(const uint8_t &new_status)
void update(const Battery &battery)
signed short int16_t
std::vector< uint8_t > values
void update(const bool &is_alive)
DiagnosticTask(const std::string name)
void update(const std::vector< uint8_t > &new_values)


xbot_node
Author(s): Roc, wangpeng@droid.ac.cn
autogenerated on Sat Oct 10 2020 03:28:13