Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 57

image_proc not publishing image_rect data after synchronizing camera_info

$
0
0
I have a camera driver without the camera_info topic. I am publishing this topic separately and synchronizing them with all the image_proc topics. I am getting data in image_mono and image_color but not in image_rect or image_rect_color topics. I am still getting a warning for non-synchronization. [ WARN] [1512057285.359548566]: [image_transport] Topics '/camera/0/0/image_color' and '/camera/0/0/camera_info' do not appear to be synchronized. In the last 10s: Image messages received: 297 CameraInfo messages received: 300 Synchronized pairs: 0 Below is the sync node. #include #include #include #include #include #include #include using namespace sensor_msgs; using namespace message_filters; ros::Publisher image_raw_pub; ros::Publisher image_mono_pub; ros::Publisher image_color_pub; ros::Publisher image_rect_pub; ros::Publisher image_rect_color_pub; ros::Publisher camera_info_pub; void callback(const Image::ConstPtr& image1, const Image::ConstPtr& image2, const Image::ConstPtr& image3, const Image::ConstPtr& image4, const Image::ConstPtr& image5, const CameraInfo::ConstPtr& info) { // Solve all of perception here... ROS_INFO("Sync_Callback"); image_raw_pub.publish(image1); image_mono_pub.publish(image2); image_color_pub.publish(image3); image_rect_pub.publish(image4); image_rect_color_pub.publish(image5); camera_info_pub.publish(info); } int main(int argc, char** argv) { ros::init(argc, argv, "camera_info_node"); std::string img_raw_topic = "/camera/0/0/image_raw"; std::string img_mono_topic = "/camera/0/0/image_mono"; std::string img_color_topic = "/camera/0/0/image_color"; std::string img_rect_topic = "/camera/0/0/image_rect"; std::string img_rect_color_topic = "/camera/0/0/image_rect_color"; std::string camera_info_topic = "/camera/0/0/camera_info"; ros::NodeHandle nh; message_filters::Subscriber image_raw_sub(nh, img_raw_topic, 100); message_filters::Subscriber image_mono_sub(nh, img_mono_topic, 100); message_filters::Subscriber image_color_sub(nh, img_color_topic, 100); message_filters::Subscriber image_rect_sub(nh, img_rect_topic, 100); message_filters::Subscriber image_rect_color_sub(nh, img_rect_color_topic, 100); message_filters::Subscriber camera_info_sub(nh, camera_info_topic, 100); image_raw_pub = nh.advertise(img_raw_topic, 1000); image_mono_pub = nh.advertise(img_mono_topic, 1000); image_color_pub = nh.advertise(img_color_topic, 1000); image_rect_pub = nh.advertise(img_rect_topic, 1000); image_rect_color_pub = nh.advertise(img_rect_color_topic, 1000); camera_info_pub = nh.advertise(camera_info_topic, 1000); typedef sync_policies::ApproximateTime MySyncPolicy; // ApproximateTime takes a queue size as its constructor argument, hence MySyncPolicy(10) Synchronizer sync(MySyncPolicy(10), image_raw_sub, image_mono_sub, image_color_sub, image_rect_sub, image_rect_color_sub, camera_info_sub); sync.registerCallback(boost::bind(&callback, _1, _2, _3, _4, _5, _6)); ros::spin(); return 0; } **EDIT:** On synchronizing only image_raw, image_mono and camera_info, the warning message is removed. However, the image_rect and image_rect_color still does not publish anything. Note: The two topics are being subscribed but no messages are being published.

Viewing all articles
Browse latest Browse all 57

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>