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

Subscriber data not up to date

asked 2014-10-16 18:41:17 -0500

Giza gravatar image

I have written a subscriber to one of the image topics and I have set my buffer to 1 using:

subscriber =rospy.Subscriber("/camera/rgb/image_mono/compressed",CompressedImage, callback, queue_size=1)

However my subscriber still lags behind. Any idea what might be causing this? Am I setting the queue size correctly?

edit retag flag offensive close merge delete


How much lag are you seeing? How are you measuring it?

ahendrix gravatar image ahendrix  ( 2014-10-16 19:59:06 -0500 )edit

Does it also lag if you display the pointcloud in RViz?

BennyRe gravatar image BennyRe  ( 2014-10-17 02:22:48 -0500 )edit

@ahendrix Its about 5 to 10 seconds of lag. Basically when I look at the screen it shows images of things that happened 5 to 10 swconds ago.

Giza gravatar image Giza  ( 2014-10-17 11:00:35 -0500 )edit

@BennyRe I tried it on on image_view and theres no lag but that is because I do a lot of processing on the image before I display it (cv2.imshow) . Now I cannot process at the rate that the publisher is publishing and so what I want to do is drop any messages that arrive while I am processing.

Giza gravatar image Giza  ( 2014-10-17 11:22:23 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-10-17 11:55:15 -0500

ahendrix gravatar image

It sounds like the lag you're seeing is caused by the image processing that you're doing.

If you're seeing one new image displayed by your algorithm every 5-10 seconds, then it's probably working properly, and the lag you see is the result of your processing time.

edit flag offensive delete link more


That's right! And by the time Im done processing some time would have passed!! So in terms of viewing the data Ill always be behind..

Giza gravatar image Giza  ( 2014-10-17 13:21:01 -0500 )edit

Question Tools


Asked: 2014-10-16 18:41:17 -0500

Seen: 416 times

Last updated: Oct 17 '14