In response to @ahendrix, this an use-case
the data: "asdf.yaml"
namespace1: {data1: 1, data2: 2}
namespace2: {data3: 3, data4: 4.5}
the use-case:
> rosparam load asdf.yaml main
> rosparam list
/main/namespace1/data1
/main/namespace1/data2
/main/namespace2/data3
/main/namespace2/data4
...and other ros stuff
> rosparam get main/namespace1/data1
1
In an IPython console
> data = rosparam.load_file("asdf.yaml")
[({'main': {'namespace1': {'data1': 1, 'data2': 2}, 'namespace2': {'data3': 3, 'data4': 4.5}}},'/')]
# The parameter server is not touched, it just returns a list
> rospy.set_param("main", data)
> rospy.get_param("main")
[[{'namespace1': {'data1': 1, 'data2': 2}, 'namespace2': {'data3': 3, 'data4': 4.5}}, '/']]
Outside, in another terminal:
> rosparam list
/main
> rosparam get main/namespace1/data1
ERROR: Parameter [/main/namespace1/data1] is not set
So it doesn't load the namespace structure I think.
This is duplicate of http://answers.ros.org/question/58819... , there is an answer there.