Go to the documentation of this file.
6 #include <std_msgs/Float32.h>
7 #include <nav_msgs/Odometry.h>
12 typedef diagnostic_msgs::DiagnosticStatus
DS;
29 ROS_INFO(
"Starting initialization timer...");
43 "swri::Subscriber test (manual diagnostics)",
this,
48 "swri::Subscriber test (auto diagnostics)",
this,
53 "swri::Subscriber test (value diagnostics)",
this,
68 status.
summary(DS::OK,
"No errors reported.");
82 status.
mergeSummary(DS::WARN,
"Timeouts have occurred.");
88 status.
addf(
"Topic Name",
"%s -> %s",
104 status.
addf(
"Timed Out Count",
"%d [> %f ms]",
108 status.
add(
"Timed Out Count",
"N/A");
114 status.
summary(DS::OK,
"No errors reported.");
131 status.
summary(DS::WARN,
"No message has been received.");
132 status.
add(
"Float value",
"N/A");
134 status.
summary(DS::OK,
"No errors reported.");
136 status.
addf(
"Float value (data())",
"%f",
sub_.
data()->data);
146 int main(
int argc,
char **argv)
148 ros::init(argc, argv,
"latched_subscriber_test");
void handleDiagnosticsTimer(const ros::TimerEvent &ignored)
void initialize(ros::NodeHandle &nh, const std::string &topic, const ros::TransportHints &transport_hints=ros::TransportHints())
ros::WallTimer init_timer_
double maxPeriodMilliseconds() const
double meanPeriodMilliseconds() const
void add(const std::string &key, const bool &b)
double meanFrequencyHz() const
ROSCPP_DECL void init(const M_string &remappings, const std::string &name, uint32_t options=0)
void initialize(const ros::WallTimerEvent &ignored)
const std::string & mappedTopic() const
void summary(const diagnostic_msgs::DiagnosticStatus &src)
diagnostic_msgs::DiagnosticStatus DS
void appendDiagnostics(diagnostic_updater::DiagnosticStatusWrapper &status, const std::string &name, const int flags)
double timeoutMilliseconds() const
const std::string & unmappedTopic() const
double maxLatencyMicroseconds() const
swri::LatchedSubscriber< std_msgs::Float32 > sub_
void manualDiagnostics(du::DiagnosticStatusWrapper &status)
const boost::shared_ptr< M const > & data() const
int main(int argc, char **argv)
void mergeSummary(const diagnostic_msgs::DiagnosticStatus &src)
void setHardwareID(const std::string &hwid)
void autoDiagnostics(du::DiagnosticStatusWrapper &status)
du::Updater diagnostic_updater_
int numPublishers() const
double meanLatencyMicroseconds() const
void valueDiagnostics(du::DiagnosticStatusWrapper &status)
void setTimeout(const ros::Duration &time_out)
void addf(const std::string &key, const char *format,...)
double minPeriodMilliseconds() const
bool timeoutEnabled() const
void add(const std::string &name, TaskFunction f)
double minLatencyMicroseconds() const
Timer createTimer(Duration period, const TimerCallback &callback, bool oneshot=false, bool autostart=true) const
WallTimer createWallTimer(WallDuration period, const WallTimerCallback &callback, bool oneshot=false, bool autostart=true) const
swri_roscpp
Author(s): P. J. Reed
autogenerated on Fri Aug 2 2024 08:39:15