35 const boost::optional<ixblue_stdbin_decoder::Data::INSSystemStatus>& systemStatus,
36 const boost::optional<ixblue_stdbin_decoder::Data::INSAlgorithmStatus>&
54 status.
summary(diagnostic_msgs::DiagnosticStatus::ERROR,
"No data received yet");
61 status.
summary(diagnostic_msgs::DiagnosticStatus::ERROR, ss.str());
74 status.
add(
"algorithm_status_1", algoStatus1.to_string());
75 status.
add(
"algorithm_status_2", algoStatus2.to_string());
76 status.
add(
"algorithm_status_3", algoStatus3.to_string());
77 status.
add(
"algorithm_status_4", algoStatus4.to_string());
79 status.
add(
"system_status_1", systemStatus1.to_string());
80 status.
add(
"system_status_2", systemStatus2.to_string());
81 status.
add(
"system_status_3", systemStatus3.to_string());
83 if(systemStatus1.test(
84 ixblue_stdbin_decoder::Data::INSSystemStatus::Status1::SERIAL_IN_R_ERR))
86 status.
summary(diagnostic_msgs::DiagnosticStatus::ERROR,
87 "Serial input error");
89 else if(systemStatus1.test(
90 ixblue_stdbin_decoder::Data::INSSystemStatus::Status1::INPUT_A_ERR))
93 status.
summary(diagnostic_msgs::DiagnosticStatus::ERROR,
94 "GNSS or Input A error");
100 status.
summary(diagnostic_msgs::DiagnosticStatus::ERROR,
101 "System is waiting for position");
103 else if(algoStatus1.test(
104 ixblue_stdbin_decoder::Data::INSAlgorithmStatus::Status1::ALIGNMENT))
106 status.
summary(diagnostic_msgs::DiagnosticStatus::WARN,
107 "System in alignment, do not move");
110 Status1::FINE_ALIGNMENT))
112 status.
summary(diagnostic_msgs::DiagnosticStatus::OK,
"Fine alignment");
114 else if(algoStatus1.test(
115 ixblue_stdbin_decoder::Data::INSAlgorithmStatus::Status1::NAVIGATION))
117 status.
summary(diagnostic_msgs::DiagnosticStatus::OK,
"System in navigation");
121 status.
summary(diagnostic_msgs::DiagnosticStatus::OK,
"");
double connection_lost_timeout
boost::optional< ixblue_stdbin_decoder::Data::INSSystemStatus > lastSystemStatus
void diagTimerCallback(const ros::TimerEvent &)
void summary(unsigned char lvl, const std::string s)
void setHardwareID(const std::string &hwid)
const double frequency_tolerance
void add(const std::string &name, TaskFunction f)
double expected_frequency
void setHardwareID(const std::string &hwId)
ros::Timer diagnosticsTimer
boost::optional< ixblue_stdbin_decoder::Data::INSAlgorithmStatus > lastAlgorithmStatus
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
Timer createTimer(Rate r, Handler h, Obj o, bool oneshot=false, bool autostart=true) const
void stdImuTick(const ros::Time &stamp)
void updateStatus(const boost::optional< ixblue_stdbin_decoder::Data::INSSystemStatus > &systemStatus, const boost::optional< ixblue_stdbin_decoder::Data::INSAlgorithmStatus > &algorithmStatus)
std::unique_ptr< diagnostic_updater::TopicDiagnostic > stdImuTopicDiagnostic
diagnostic_updater::Updater diagnosticsUpdater
void add(const std::string &key, const T &val)
ros::SteadyTime lastMessageReceivedStamp
DiagnosticsPublisher(ros::NodeHandle &nh)
void produceStatusDiagnostics(diagnostic_updater::DiagnosticStatusWrapper &status)