Go to the documentation of this file.
32 #include "diagnostic_msgs/SelfTest.h"
67 ROS_INFO(
"Doing preparation stuff before we run our test.\n");
68 status.
summary(diagnostic_msgs::DiagnosticStatus::OK,
"Pretest completed successfully.");
77 bool lookup_successful =
true;
79 if (lookup_successful)
81 status.
summary(diagnostic_msgs::DiagnosticStatus::OK,
"ID Lookup successful");
86 status.
summary(diagnostic_msgs::DiagnosticStatus::ERROR,
"ID Lookup failed");
96 status.
summary(diagnostic_msgs::DiagnosticStatus::OK,
"We made it past the exception throwing statement.");
104 status.
summary(diagnostic_msgs::DiagnosticStatus::OK,
"We successfully changed the value.");
111 status.
summary(diagnostic_msgs::DiagnosticStatus::OK,
"We observed the change in value");
115 status.
summaryf(diagnostic_msgs::DiagnosticStatus::ERROR,
"We failed to observe the change in value, it is currently %f.",
some_val);
121 ROS_INFO(
"Doing cleanup stuff after we run our test.\n");
122 status.
summary(diagnostic_msgs::DiagnosticStatus::OK,
"Posttest completed successfully.");
137 int main(
int argc,
char** argv)
void add(const std::string &key, const bool &b)
ROSCPP_DECL void init(const M_string &remappings, const std::string &name, uint32_t options=0)
void test4(diagnostic_updater::DiagnosticStatusWrapper &status)
void test1(diagnostic_updater::DiagnosticStatusWrapper &status)
void add(const std::string &name, TaskFunction f)
void summary(const diagnostic_msgs::DiagnosticStatus &src)
Class to facilitate the creation of component self-tests.
Simple node with a self test that reports an error.
void setID(std::string id)
Sets the ID of the part being tested.
void posttest(diagnostic_updater::DiagnosticStatusWrapper &status)
void test3(diagnostic_updater::DiagnosticStatusWrapper &status)
void checkTest()
Check if a self-test is pending. If so, start it and wait for it to complete.
void pretest(diagnostic_updater::DiagnosticStatusWrapper &status)
void test2(diagnostic_updater::DiagnosticStatusWrapper &status)
void summaryf(unsigned char lvl, const char *format,...)
int main(int argc, char **argv)
self_test::TestRunner self_test_
self_test
Author(s): Kevin Watts, Brice Rebsamen
, Jeremy Leibs and Blaise Gassend
autogenerated on Tue Nov 15 2022 03:17:24