0
$\begingroup$

Rosanswers logo

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?


Originally posted by Giza on ROS Answers with karma: 43 on 2014-10-16

Post score: 0


Original comments

Comment by ahendrix on 2014-10-16:
How much lag are you seeing? How are you measuring it?

Comment by BennyRe on 2014-10-17:
Does it also lag if you display the pointcloud in RViz?

Comment by Giza on 2014-10-17:
@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.

Comment by Giza on 2014-10-17:
@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.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by ahendrix with karma: 47576 on 2014-10-17

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Giza on 2014-10-17:
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..

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.