How can a node keep working while it waits for another one to publish on a topic?
I have a node (A) that works over a list of variables. This list should be updated regularly with the information given by another node (B). I can't rely on B working at a certain frequency and, as I don't want A to stop working in a ros::spin() (as B could take very long to publish something) I can't use the usual topic/callback. How could I implement this idea?
Asked by eric.valls.grunewald on 2019-03-01 04:55:58 UTC
Answers
Please take a look at ros::spinOnce()
.
See roscpp/Overview/Callbacks and Spinning for more info on the different threading models.
I would also recommend to take a look at message_filters, particularly Cache
.
Asked by gvdhoorn on 2019-03-01 05:58:46 UTC
Comments
I realise searching can be difficult (due to keywords being used), but this has been discussed many times before.
In the future: could you please include what you've searched for yourself, what you've tried, what you've observed, etc? That avoids posters from suggesting things you've seen.
Asked by gvdhoorn on 2019-03-01 06:00:20 UTC
Comments