How to implement complex parameters in cpp?
I have written a package to support simple PWM servo motors. To support some features, the node must be initialized with settings for each servo. Here is an example:
/config_servos "servos: [{servo: 1, center: 333, range: 100, direction: -1}, {servo: 2, center: 336, range: 108, direction: 1}]"
This initialized two servos - each having a center, range, and direction parameter. There can be many servos.
Currently a user of the node, must make a service call to perform the configuration. I'd like to make it possible for this setup to be done via the launch file or some similar external file rather than require it be coded.
Is there an example or best practice for how to initialize objects?
Here is a link to the draft documentation which shows all of the current configuration services: http://bradanlane.gitlab.io/ros-i2cpw...