Best practice for online re-configuration between nodes [closed]
Dear all,
I'm looking for the best way to achieve the following (in cpp on Fuerte).
At the moment, I have one node which should be dynamically reconfigurable (i.e.: start, stop, set camera frame rate). In the long run, there will be many nodes that should be configurable by other nodes, often by one node switching the system into different states. The current state of each node should be accessible by all other nodes. What's the best design to achieve this?
My ideas so far:
- Use dynamic_reconfigure in each node.
- Provide services for all configurations in each node.
- Use the parameter_server for exchange of parameters and offer an updateFromServer()-service in each node. Other nodes set the new parameters on the server and then trigger the service to reconfigure accordingly. Probably not very clever as there can be inconsistencies / false assumptions about the current configurations.
- Use the parameter server with different parameters for the desired (new) configuration and the actual one, again coupled with a updateFromServer()-service. Other nodes set the desired parameter and call the service for starting the reconfiguration. After reconfiguring, the node updates the actual values on the parameter server (where the caller can check, if needed).
In case of three and four, I could probably use a regular getParamCached() call instead of the service (?).
Do any of these seem reasonable? Do you have comments on possible benefits/downsides of using on or another, e.g. in terms of performance, manageability of code (including n services of different other nodes), best practices? Or is there some other method that I didn't discover yet?
I'd appreciate your comments or recommendations!
Regards,
Philip
P.S.: If there's any changes between Fuerte and Groovy that may benefit my use-case, I'd probably consider upgrading.
EDIT (in reply to comments): I am not looking for setting and reading a configuration state for the whole system, for which a nice solution was already given here. I'm rather looking for a way to be able to access and configure each node's parameters on their own during runtime. Thanks for all your input!
EDIT (out of curiosity): In this tutorial, turtlesim is re-configured at runtime via something like method 3 as described above (this is probably where I got that idea in the first place). Does anybody know a specific reason why it is done this way?
You might want to see this question that I asked. There are some good tips in there, and I had a very similar situation.
Thanks for your comment! I've actually browsed through quite a lot of answers in order to get a rough idea for what I'm looking for, and your question was one that helped me quite a bit. However, I'm more looking for configuration per node instead of a "global" configuration state.
Since you want nodes to be configurable from other nodes, with the other nodes monitoring their state, you really are asking for global configuration state, aren't you?
Sorry for the confusion! Of course something accessible from everywhere is global :-) I updated the question to clarify.