Hi, My apologies if the question is unclear, I'll elaborate here:
I have a node that publishes real-time image to a topic at 30Hz.
I am writing another node that subscribes to this topic and processes the image (find a target in the image).
The processing time varies, sometimes the algorithm can process images at 10Hz, sometimes 5Hz.
I want my node to process a frame, and after it finishes, get the latest frame and process that.
I tried setting queue_size of my publisher to 1, I thought that would force all old messages to be dropped. However that didn't work. My callback is just processing the old frames that's remained in the pipeline(whose size I don't know how to set)
Can someone help me with this? I'm using python. I'm trying to build a sampling port rather than a queuing port, if this explanation helps.
Another question:
Does ros spawns a new thread for callback function every time a new message is available in a topic?
How many buffers/pipes are there in a publisher->topic->subscriber system?
Thank you!
Nick
Originally posted by nickzhang on ROS Answers with karma: 41 on 2017-12-29
Post score: 0