listing parameters or using a dictionary
In C++, is there a way to list parameters on the parameter server, optionally those in a particular namespace? Alternatively, can I use a dictionary/map?
I want to put a mapping name/number in a yaml file loaded by roslaunch, and my node should be able to list the names and retrieve the associated number. rosparam list can do that, and associated with grep I can retrieve only the parameters I want. can I do that in C++ directly. the parameter server c++ API does not seem to provide that, or is it hidden? Can it be added in future releases?
I tried using a dictionary but it was expended in a list of parameters instead of being a dictionary data structure, i.e. those 2 yaml files yielded the same result
channel_numbers: {applanix: 0, radar: 1, trimble: 5, velodyne: 10}
and
channel_numbers:
applanix: 0
radar: 1
trimble: 5
velodyne: 10
I would like something like:
ros::NodeHandle nh("~");
vector<string> parameters = nh.list_parameters("channel_numbers");
// and then for each parameter in parameters get its value...