44 stat.
summary(diagnostic_msgs::DiagnosticStatus::OK,
"System State OK");
45 stat.
add(
"System",
false);
46 stat.
add(
"Accel",
false);
47 stat.
add(
"Gyro",
false);
48 stat.
add(
"Mag",
false);
49 stat.
add(
"Pressure",
false);
50 stat.
add(
"GNSS",
false);
51 stat.
add(
"Acc OOR",
false);
52 stat.
add(
"Gyro OOR",
false);
53 stat.
add(
"Mag OOR",
false);
54 stat.
add(
"Pressure OOR",
false);
55 stat.
add(
"Min Temp",
false);
56 stat.
add(
"Max Temp",
false);
57 stat.
add(
"Low V",
false);
58 stat.
add(
"High V",
false);
59 stat.
add(
"GNSS ANT DC",
false);
60 stat.
add(
"Data Overflow",
false);
64 stat.
summary(diagnostic_msgs::DiagnosticStatus::ERROR,
"System FAULT");
67 stat.
add(
"System",
true);
71 stat.
add(
"System",
false);
75 stat.
add(
"Accel",
true);
79 stat.
add(
"Accel",
false);
83 stat.
add(
"Gyro",
true);
87 stat.
add(
"Gyro",
false);
91 stat.
add(
"Mag",
true);
95 stat.
add(
"Mag",
false);
99 stat.
add(
"Pressure",
true);
103 stat.
add(
"Pressure",
false);
107 stat.
add(
"GNSS",
true);
111 stat.
add(
"GNSS",
false);
115 stat.
add(
"Acc OOR",
true);
119 stat.
add(
"Acc OOR",
false);
123 stat.
add(
"Gyro OOR",
true);
127 stat.
add(
"Gyro OOR",
false);
131 stat.
add(
"Mag OOR",
true);
135 stat.
add(
"Mag OOR",
false);
139 stat.
add(
"Pressure OOR",
true);
143 stat.
add(
"Pressure OOR",
false);
147 stat.
add(
"Min Temp",
true);
151 stat.
add(
"Min Temp",
false);
155 stat.
add(
"Max Temp",
true);
159 stat.
add(
"Max Temp",
false);
163 stat.
add(
"Low V",
true);
167 stat.
add(
"Low V",
false);
171 stat.
add(
"High V",
true);
175 stat.
add(
"High V",
false);
179 stat.
add(
"GNSS ANT DC",
true);
183 stat.
add(
"GNSS ANT DC",
false);
187 stat.
add(
"Data Overflow",
true);
191 stat.
add(
"Data Overflow",
false);
197 stat.
summary(diagnostic_msgs::DiagnosticStatus::STALE,
"Waiting on initial SystemState packet");
203 uint8_t level = diagnostic_msgs::DiagnosticStatus::OK;
210 if( currentValue ==
false )
212 level = diagnostic_msgs::DiagnosticStatus::WARN;
214 stat.
add(
"Orient INIT", currentValue);
217 if( currentValue ==
false )
219 level = diagnostic_msgs::DiagnosticStatus::WARN;
221 stat.
add(
"Nav INIT", currentValue);
224 if( currentValue ==
false )
226 level = diagnostic_msgs::DiagnosticStatus::WARN;
228 stat.
add(
"Heading INIT", currentValue);
231 if( currentValue ==
false )
233 level = diagnostic_msgs::DiagnosticStatus::WARN;
235 stat.
add(
"Time INIT", currentValue);
242 std::string currentStatusStr(
"");
247 level = diagnostic_msgs::DiagnosticStatus::WARN;
248 currentStatusStr = std::string(
"No Fix");
253 currentStatusStr = std::string(
"2D Fix");
258 currentStatusStr = std::string(
"3D Fix");
263 currentStatusStr = std::string(
"SBAS");
268 currentStatusStr = std::string(
"Diff");
273 currentStatusStr = std::string(
"Omni/Star");
278 currentStatusStr = std::string(
"RTK Float");
283 currentStatusStr = std::string(
"RTK Fixed");
288 currentStatusStr = std::string(
"CODING ERROR: YOU CAN'T GET HERE!!!");
292 stat.
add(
"Fix Status", currentStatusStr);
306 stat.
add(
"Event1", event1);
307 stat.
add(
"Event2", event2);
308 stat.
add(
"Internal GNSS Enabled", internalGNSSEnabled);
309 stat.
add(
"Dual ANT Heading Active", dualAntennaHeadingActive);
310 stat.
add(
"Vel Heading Enabled", velocityHeadingEnabled);
311 stat.
add(
"Atm Alt Enabled", atmosphericAltitudeEnabled);
312 stat.
add(
"EXT Pos Active", extPositionActive);
313 stat.
add(
"EXT Vel Active", extVelocityActive);
314 stat.
add(
"EXT Heading Active", extHeadingActive);
317 if( level == diagnostic_msgs::DiagnosticStatus::OK )
319 stat.
summary(level,
"Filters OK");
323 stat.
summary(level,
"Filters have issues");
328 level = diagnostic_msgs::DiagnosticStatus::STALE;
329 stat.
summary(level,
"Waiting on initial FilterStatus packet");
void UpdateSystemStatus(diagnostic_updater::DiagnosticStatusWrapper &stat)
bool receivedSystemStatus_
void summary(unsigned char lvl, const std::string s)
bool receivedFilterStatus_
Contains diagnostic information published out the ROS diagnostics topic.
void add(const std::string &key, const T &val)
void UpdateFilterStatus(diagnostic_updater::DiagnosticStatusWrapper &stat)