What is the preferable way to share states among multiple nodes in ROS?
Hi all,
I am developing a robot software system base on ROS that have mutiple nodes, such as base , localization , planning, perception, control, actuator, battery, etc. And each node has it's own states, such as base node has states of velocity of wheels, encoder values, motor state... And some nodes need to know the others nodes' states to do their work. For example, control node need know states of localization, base, actuator, perception.
The ways to do this I know are:
- use pub/sub
- use service
- use parameter_server
for the first 2, I need define a lot of custom messages and services, and the topics need to publish at a high frequency, or I need to call serveral services at the same time, which I think it's not a good way. for the 3rd one, I think it can do what I want, but I don't know if this is the correct way to use the parameter server and if it's suitable to use in high update frequency situation.
So what is the preferabel way to share states among multiple nodes, hope you guys could give me some clue or suggestions. Thanks in advance!