ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Callback never called on c++

asked 2011-10-24 20:09:02 -0500

CaptainTrunky gravatar image

updated 2014-01-28 17:10:38 -0500

ngrennan gravatar image

Hi! I have a little project on C++. When it was very simple (take frame from Kinect, convert to cv::Mat and show it in window), everything works well. Some days ago I add classificator and after it, in some reasons, callback never calls, as I understand. I can't get, why it so, because of code not changed in general. Can somebody helps me with it? Thanks!

Here link to archive - http://dl.dropbox.com/u/16807894/depthListen.zip

edit retag flag offensive close merge delete

Comments

Have you checked if the Kinect messages are getting published at all (Using rostopic hz /camera/depth/image)? Some people (including me) are having problems with the current openni driver sometimes not publishing the desired messages: http://answers.ros.org/question/2386
Ben_S gravatar image Ben_S  ( 2011-10-24 20:58:46 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2011-10-24 20:45:16 -0500

updated 2011-10-24 20:50:59 -0500

You do a lot of work in your callback, and your subscribe queue is limited to one image. It is not surprising that frames get dropped while your callback is busy with your classifier.

As I see it, you have three options:

  1. Ignore the frame drops, and process just those frames you can actually handle.

  2. Increase the queue size. This will only work if you can keep up with the frame rate most of the time. Otherwise, your queue will just fill up and your node will lag behind accordingly.

  3. Do less work in your callback. Improve the speed of your classifier.

edit flag offensive delete link more

Comments

Thank you very much. Both advices were very useful! Everything works fine.

CaptainTrunky gravatar image CaptainTrunky  ( 2011-10-26 00:08:59 -0500 )edit

Question Tools

Stats

Asked: 2011-10-24 20:09:02 -0500

Seen: 689 times

Last updated: Oct 26 '11