Hello,
I'm using ROS Kinetic.
I'd like to have multiple instances of a dynamic_reconfigure server in a node, and I'm wondering how to achieve that.
I have different robots that I define in YAML files with a specific number of motors for each robot.
I have a dynamic_reconfigure config file in my package that allows me to set min, max, offset and enable parameters for a motor.
But I need to be able to tune those parameters for each motor defined in the YAML file, and that is unknown at compile time. I can't dynamically allocate some array of server because at runtime I don't have the callbacks created.
A way, which I don't really like, could be to add a string or int field to the parameters, and type the motor name or index to apply the values to that specific motor in the code. There could be a bool parameter also to apply the new values in the client node when set to true.
Another way could be to create a nodelet class of a motor with its own dynamic reconfigure server and callback, and have a vector of them in the main node, and push back as many as needed.
The other way could be to use services instead, but then I couldn't use the rqt_reconfigure gui.
Is there a good practice for doing this kind of thing ?
Thanks!
↧