30 import diagnostic_updater
32 from diagnostic_msgs.msg
import DiagnosticStatus
44 self.updater.setHardwareID(
"none")
49 self.updater.setHardwareID(
"firmware-%d" % msg.header.software_version)
58 value = getattr(msg, field)
59 matching_status = [x[len(field) + 1:]
for x
in dir(msg)
if x.startswith(field.upper())
and 60 value == getattr(msg, x)]
61 if len(matching_status) != 1:
62 return "No matching constant" 63 return matching_status[0]
67 value = getattr(msg, field)
68 matching_statuses = [x[len(field) + 1:]
for x
in dir(msg)
if x.startswith(field.upper())
and 69 value & getattr(msg, x)]
70 return ', '.join(matching_statuses)
74 stat.add(
"GNSS Solution Status",
76 stat.add(
"GNSS Position Type",
81 if self.last_inspvax.ins_status != INSPVAX.INS_STATUS_SOLUTION_GOOD:
82 stat.summary(DiagnosticStatus.WARN,
"INS Solution not GOOD.")
83 elif self.last_inspvax.position_type != INSPVAX.POSITION_TYPE_PPP:
84 stat.summary(DiagnosticStatus.WARN,
"INS Position type not PPP.")
86 stat.summary(DiagnosticStatus.OK,
"INS Solution GOOD, PPP fix present.")
88 stat.add(
"INS Solution Status",
90 stat.add(
"INS Position Type",
92 stat.add(
"INS Extended Status",
94 stat.add(
"Seconds since last ZUPT or position update.",
95 self.last_inspvax.seconds_since_update)
96 stat.add(
"Receiver Status",
100 stat.summary(DiagnosticStatus.ERROR,
101 "No INSPVAX logs received from Novatel system.")
def get_status_bitfield(msg, field)
def produce_diagnostics(self, stat)
def bestpos_callback(self, msg)
def inspvax_callback(self, msg)
def get_status_string(msg, field)