46 message_ = status->message;
47 hw_id_ = status->hardware_id;
48 values_ = status->values;
71 if (
name_ != status->name)
73 ROS_ERROR(
"Incorrect name when updating StatusItem. Expected %s, got %s",
name_.c_str(), status->name.c_str());
77 double update_interval = (
ros::Time::now() - update_time_).toSec();
78 if (update_interval < 0)
79 ROS_WARN(
"StatusItem is being updated with older data. Negative update time: %f", update_interval);
82 message_ = status->message;
83 hw_id_ = status->hardware_id;
84 values_ = status->values;
96 status->name =
"/" + output_name_;
98 status->name = path +
"/" + output_name_;
100 status->level = level_;
101 status->message = message_;
102 status->hardware_id = hw_id_;
103 status->values = values_;
DiagnosticLevel valToLevel(const int val)
Converts in to DiagnosticLevel. Values: [0, 3].
StatusItem(const diagnostic_msgs::DiagnosticStatus *status)
Constructed from const DiagnosticStatus*.
boost::shared_ptr< diagnostic_msgs::DiagnosticStatus > toStatusMsg(const std::string &path, const bool stale=false) const
Prepends "path/" to name, makes item stale if "stale" true.
DiagnosticLevel
Level of StatusItem. OK, Warn, Error, Stale.
std::string getOutputName(const std::string item_name)
Replace "/" with "" in output name, to avoid confusing robot monitor.
bool update(const diagnostic_msgs::DiagnosticStatus *status)
Must have same name as original status or it won't update.