Go to the documentation of this file.
18 #include <gtest/gtest.h>
20 #include <sensor_msgs/Image.h>
22 #include "../test_utils.h"
26 template <
typename ROS_T>
36 public:
void Cb(
const ROS_T& _msg)
53 TEST(ROSSubscriberTest, Image)
57 using namespace std::chrono_literals;
65 int main(
int argc,
char **argv)
67 ::testing::InitGoogleTest(&argc, argv);
68 ros::init(argc, argv,
"ros_image_subscriber");
70 return RUN_ALL_TESTS();
ros::Subscriber sub
ROS subscriber;.
MyTestClass(const std::string &_topic)
ROSCPP_DECL void init(const M_string &remappings, const std::string &name, uint32_t options=0)
ros::NodeHandle n
ROS node handle;.
void compareTestMsg(const std_msgs::Header &_msg)
Compare a message with the populated for testing.
void waitUntilBoolVarAndSpin(bool &_boolVar, const std::chrono::duration< Rep, Period > &_sleepEach, const int _retries)
Wait until a boolean variable is set to true for a given number of times. This function calls ros::sp...
int main(int argc, char **argv)
bool callbackExecuted
Member variables that flag when the actions are executed.
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())
void Cb(const IGN_T &_msg)
TEST(ROSSubscriberTest, Image)
A class for testing ROS topic subscription.
ros_ign_image
Author(s):
autogenerated on Sat Mar 11 2023 04:02:19