ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
The easiest way is to use an existing dynamic reconfigure client which does the work of converting to or from messages on that topic into the cfg type which is delivered to a callbac, or published out via update_configuration()
: http://wiki.ros.org/dynamic_reconfigure/Tutorials/UsingTheDynamicReconfigurePythonClient or http://wiki.ros.org/dynamic_reconfigure/Tutorials/SettingUpDynamicReconfigureForANode%28cpp%29
Or you can do the same on the server side.
But if you want to use the raw message (implementing your own custom client or server) you can:
$ rostopic info /example_server_node/parameter_updates
Type: dynamic_reconfigure/Config
...
$ rosmsg show dynamic_reconfigure/Config
dynamic_reconfigure/BoolParameter[] bools
string name
bool value
dynamic_reconfigure/IntParameter[] ints
string name
int32 value
dynamic_reconfigure/StrParameter[] strs
string name
string value
dynamic_reconfigure/DoubleParameter[] doubles
string name
float64 value
dynamic_reconfigure/GroupState[] groups
string name
bool state
int32 id
int32 parent
Using the above information you can populate a Config
message for publishing or decipher it in a subscriber callback. Use push_back for C++ or append in python to add IntParameters or any of the other types. You just need to use the same names in the right type slots as in the cfg file. (I believe if you only partially populate it still works, and extra names that don't match any in the cfg are ignored silently, but I haven't tried that)
I'm not sure how the groups work but if you rostopic echo an example with a group in it maybe it is self explanatory.