1 #include <boost/bind.hpp> 4 #include <boost/bind.hpp> 8 #include <std_msgs/Float32.h> 9 #include <nav_msgs/Odometry.h> 14 typedef diagnostic_msgs::DiagnosticStatus
DS;
31 ROS_INFO(
"Starting initialization timer...");
52 diagnostic_updater_.
add(
53 "swri::Subscriber test (manual diagnostics)",
this,
56 diagnostic_updater_.
add(
57 "swri::Subscriber test (auto diagnostics)",
this,
72 diagnostic_updater_.
update();
77 status.
summary(DS::OK,
"No errors reported.");
91 status.
mergeSummary(DS::WARN,
"Timeouts have occurred.");
97 status.
addf(
"Topic Name",
"%s -> %s",
113 status.
addf(
"Timed Out Count",
"%d [> %f ms]",
117 status.
add(
"Timed Out Count",
"N/A");
123 status.
summary(DS::OK,
"No errors reported.");
138 int main(
int argc,
char **argv)
140 ros::init(argc, argv,
"subscriber_test");
const std::string & mappedTopic() const
Timer createTimer(Rate r, Handler h, Obj o, bool oneshot=false, bool autostart=true) const
void summary(unsigned char lvl, const std::string s)
double maxPeriodMilliseconds() const
void setHardwareID(const std::string &hwid)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
ros::WallTimer init_timer_
void add(const std::string &name, TaskFunction f)
du::Updater diagnostic_updater_
void appendDiagnostics(diagnostic_updater::DiagnosticStatusWrapper &status, const std::string &name, const int flags)
double maxLatencyMicroseconds() const
const std::string & unmappedTopic() const
void addf(const std::string &key, const char *format,...)
void manualDiagnostics(du::DiagnosticStatusWrapper &status)
WallTimer createWallTimer(WallDuration period, void(T::*callback)(const WallTimerEvent &), T *obj, bool oneshot=false, bool autostart=true) const
#define ROS_INFO_THROTTLE(period,...)
diagnostic_msgs::DiagnosticStatus DS
double meanLatencyMicroseconds() const
int numPublishers() const
int main(int argc, char **argv)
void setTimeout(const ros::Duration &time_out)
void initialize(const ros::WallTimerEvent &ignored)
void mergeSummary(unsigned char lvl, const std::string s)
double timeoutMilliseconds() const
double minPeriodMilliseconds() const
double minLatencyMicroseconds() const
void autoDiagnostics(du::DiagnosticStatusWrapper &status)
bool timeoutEnabled() const
void handleDiagnosticsTimer(const ros::TimerEvent &ignored)
void add(const std::string &key, const T &val)
double meanPeriodMilliseconds() const
void handleMessage(const nav_msgs::OdometryConstPtr &msg)
double meanFrequencyHz() const