16 #include <gtest/gtest.h> 19 #include <sensor_msgs/CompressedImage.h> 20 #include <sensor_msgs/PointCloud2.h> 23 #include <tf2_msgs/TFMessage.h> 53 TangoRosTest(): tf_message_received_(false), point_cloud_received_(false),
54 fisheye_image_received_(false), color_image_received_(false),
55 tf_message_count_(0), point_cloud_message_count_(0),
56 fisheye_image_message_count_(0), color_image_message_count_(0) {}
60 sub_tf_ = nh_.
subscribe<tf2_msgs::TFMessage>(
63 sub_point_cloud_ = nh_.
subscribe<sensor_msgs::PointCloud2>(
81 tf_message_received_ =
true;
86 point_cloud_received_ =
true;
87 point_cloud_message_count_ ++;
91 fisheye_image_received_ =
true;
92 fisheye_image_message_count_++;
96 color_image_received_ =
true;
97 color_image_message_count_++;
124 time_t current_time = time(NULL);
126 while (current_time < end) {
128 current_time = time(NULL);
141 int main(
int argc,
char **argv){
142 testing::InitGoogleTest(&argc, argv);
144 return RUN_ALL_TESTS();
constexpr double POINT_CLOUD_RATE
bool color_image_received_
void PointCloudCallback(const boost::shared_ptr< const sensor_msgs::PointCloud2 > msg)
void FisheyeImageCallback(const sensor_msgs::ImageConstPtr &image)
bool fisheye_image_received_
int fisheye_image_message_count_
int color_image_message_count_
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
bool tf_message_received_
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
tf::TransformListener tf_listener_
int main(int argc, char **argv)
constexpr int SLEEP_TIME_UNTIL_FIRST_MESSAGE
image_transport::Subscriber sub_fisheye_image_
const std::string COLOR_IMAGE_TOPIC_NAME
void TfCallback(const boost::shared_ptr< const tf2_msgs::TFMessage > msg)
constexpr double COLOR_IMAGE_RATE
void ColorImageCallback(const sensor_msgs::ImageConstPtr &image)
constexpr double DURATION_RATE_TEST
bool point_cloud_received_
ros::Subscriber sub_point_cloud_
int point_cloud_message_count_
const std::string POINT_CLOUD_TOPIC_NAME
const std::string FISHEYE_IMAGE_TOPIC_NAME
constexpr double RATE_TOLERANCE_RATIO
ROSCPP_DECL void spinOnce()
TEST_F(TangoRosTest, TestMessagesArePublished)
image_transport::Subscriber sub_color_image_
constexpr double FISHEYE_IMAGE_RATE