callback with image and message transport not working..
Hi,
Not sure if it is bug with my code( probably it is ). Want some fresh pair of eyes on it.
So I am subscribing to the kinect2_bridge node with the following subscriber. subImageColorFull is a sd image topic
Some other topics are as follows.
topicC = K2TOPICSD K2TOPICIMAGECOLOR K2TOPICIMAGERECT; topicD = K2TOPICSD K2TOPICIMAGEDEPTH K2TOPICIMAGERECT; topicI = K2TOPICSD K2TOPICIMAGEIR K2TOPICIMAGERECT; topicF = K2TOPICSD K2TOPICIMAGE_COLOR ;
message_filters::Subscriber<sensor_msgs::Image>*subImageColorFull;
subImageColorFull = new message_filters::Subscriber<sensor_msgs::Image>(nh, topicColorFull, queueSize);
then there is the async filter I am using approximate time sync policy.
typedef message_filters::sync_policies::ApproximateTime<sensor_msgs::Image, sensor_msgs::Image, sensor_msgs::Image,
sensor_msgs::CameraInfo, sensor_msgs::CameraInfo,sensor_msgs::Image> ApproximateSyncPolicy;
And then I define the callback as follows.
syncApproximate = new message_filters::Synchronizer<ApproximateSyncPolicy>(ApproximateSyncPolicy(queueSize), *subImageColor, *subImageDepth, *subImageIr, *subCameraInfoColor, *subCameraInfoDepth,*subImageColorFull);
syncApproximate->registerCallback(boost::bind(&Receiver::callback, this,_1,_2,_3,_4,_5,_6));
The problem:
The callback is never serviced..
Can some one list out the possible bugs that I maybe overlooking ?
The code builds, compiles and runs needless to say.
One of my suspects was the topic name, I think it is ok, I am printing it out.
On a higher level, I am subscribing 6 topics from the kinect2bridge. I started with kinect2viewer and then built my code around it.
Asked by cnanda01 on 2015-09-28 13:59:19 UTC
Answers
Hi, Thanks for reviewing the post. I found my answer, after pulling my hairs out for sometime. It seems bridge does not publish a /sd/image topic. So it was indeed a problem with the topic name. The image topics name should be QHD or HD in the code. The callback is serviced now :).
Best Chinmay
Asked by cnanda01 on 2015-09-28 16:27:10 UTC
Comments
did you already tried to skip SyncApproximate and publish a log message for each topic in order to find out if the cause of the problem is the synchronizer or a single topic?
Asked by clynamen on 2015-09-28 16:04:43 UTC
"publish a log message for each topic", is that using std::cout or any other ROS tool ?
Asked by cnanda01 on 2015-09-28 16:31:23 UTC