Ask Your Question
0

callback with image and message transport not working..

asked 2015-09-28 13:59:19 -0600

cnanda01 gravatar image

updated 2015-09-28 14:35:51 -0600

gvdhoorn gravatar image

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 = K2_TOPIC_SD K2_TOPIC_IMAGE_COLOR K2_TOPIC_IMAGE_RECT; topicD = K2_TOPIC_SD K2_TOPIC_IMAGE_DEPTH K2_TOPIC_IMAGE_RECT; topicI = K2_TOPIC_SD K2_TOPIC_IMAGE_IR K2_TOPIC_IMAGE_RECT; topicF = K2_TOPIC_SD K2_TOPIC_IMAGE_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 kinect2_bridge. I started with kinect2_viewer and then built my code around it.

edit retag flag offensive close merge delete

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?

clynamen gravatar imageclynamen ( 2015-09-28 16:04:43 -0600 )edit

"publish a log message for each topic", is that using std::cout or any other ROS tool ?

cnanda01 gravatar imagecnanda01 ( 2015-09-28 16:31:23 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-09-28 16:27:10 -0600

cnanda01 gravatar image

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

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-09-28 13:59:19 -0600

Seen: 273 times

Last updated: Sep 28 '15