Go to the documentation of this file.
5 #include <gtest/gtest.h>
6 #include <rosgraph_msgs/TopicStatistics.h>
7 #include <boost/thread.hpp>
8 #include <std_msgs/Int8MultiArray.h>
14 void cb(
const rosgraph_msgs::TopicStatistics& msg) {
19 float errorMargin = 0.1;
21 return std::fabs(foundFreq - expected) / expected <= errorMargin;
34 TEST(TopicStatisticFrequency, statisticFrequency)
59 int main(
int argc,
char** argv)
61 testing::InitGoogleTest(&argc, argv);
62 ros::init(argc, argv,
"topic_statistic_frequency");
64 return RUN_ALL_TESTS();
ROSCPP_DECL void init(const M_string &remappings, const std::string &name, uint32_t options=0)
ROSCPP_DECL void shutdown()
bool frequencyAcceptable(const std::string &topic, float expected)
std::map< std::string, ros::Duration > topic_period_mean_map_
void assertEventuallyHasTopic(const Aggregator &agg, const std::string &topic)
int main(int argc, char **argv)
Subscriber subscribe(const std::string &topic, uint32_t queue_size, const boost::function< void(C)> &callback, const VoidConstPtr &tracked_object=VoidConstPtr(), const TransportHints &transport_hints=TransportHints())
TEST(TopicStatisticFrequency, statisticFrequency)
void cb(const rosgraph_msgs::TopicStatistics &msg)
test_roscpp
Author(s): Morgan Quigley, Josh Faust, Brian Gerkey, Troy Straszheim, Dirk Thomas
, Jacob Perron
autogenerated on Sat Sep 14 2024 02:59:57