I was having the exact same problem (it wasnt the choppy framerate that was the issue, it was the actual lag). When I would kill whatever image source was publishing (rosbag, camera driver, etc.), my node would still process ~5-10 frames even after the source was killed (and I was sure I had queue_size=1
)
Here is the github issue I made and it was resolved. It turns out there are multiple queues involved (not just the one that you set queue_size to 1). In my case, the default buff_size
was smaller than my images, and so my node wasn't processing them fast enough, and there always was a number of images backed up in some queue.
TL;DR
increase the buff_size
for your subscriber, as I did here. It worked for me :)