image_proc not publishing image_rect data after synchronizing camera_info

asked 2017-11-30 10:17:36 -0600

agog gravatar image

updated 2017-12-06 08:08:16 -0600

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 <message_filters/subscriber.h>
#include <message_filters/synchronizer.h>
#include <message_filters/sync_policies/approximate_time.h>
#include <sensor_msgs/Image.h>
#include <sensor_msgs/CameraInfo.h>
#include <ros/callback_queue.h>
#include <boost/bind.hpp>

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...



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> image_raw_sub(nh, img_raw_topic, 100);
  message_filters::Subscriber<Image> image_mono_sub(nh, img_mono_topic, 100);
  message_filters::Subscriber<Image> image_color_sub(nh, img_color_topic, 100);
  message_filters::Subscriber<Image> image_rect_sub(nh, img_rect_topic, 100);
  message_filters::Subscriber<Image> image_rect_color_sub(nh, img_rect_color_topic, 100);
  message_filters::Subscriber<CameraInfo> camera_info_sub(nh, camera_info_topic, 100);

  image_raw_pub = nh.advertise<Image>(img_raw_topic, 1000);
  image_mono_pub = nh.advertise<Image>(img_mono_topic, 1000);
  image_color_pub = nh.advertise<Image>(img_color_topic, 1000);
  image_rect_pub = nh.advertise<Image>(img_rect_topic, 1000);
  image_rect_color_pub = nh.advertise<Image>(img_rect_color_topic, 1000);
  camera_info_pub = nh.advertise<CameraInfo>(camera_info_topic, 1000);

  typedef sync_policies::ApproximateTime<Image, Image, Image, Image, Image, CameraInfo> MySyncPolicy;
  // ApproximateTime takes a queue size as its constructor argument, hence MySyncPolicy(10)
  Synchronizer<MySyncPolicy> 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));


  return 0;


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.

edit retag flag offensive close merge delete


I am facing the same issue with image_proc node

Nikhil_1001 gravatar image Nikhil_1001  ( 2021-07-30 02:58:14 -0600 )edit

Hi, did you manage to solve this issue?

ThreeForElvenKings gravatar image ThreeForElvenKings  ( 2022-05-01 12:30:36 -0600 )edit