参考:https://answers.ros.org/question/197304/creatingparsing-a-dictionary-of-dictionary-params/
官网:http://wiki.ros.org/roslaunch/XML/rosparam
官网解读:
The load command is considered additive: if you declare a dictionary or namespace of parameters, those parameters will be added to any other parameters declared for that namespace. Similarly, load commands can override parameters previously declared.
The <rosparam> tag can either reference a YAML file or contain raw YAML text. If the YAML text defines a dictionary, the param attribute may be omitted.
<launch>
<node pkg="beginner_tutorials" type="v1.py" name="" output="screen" respawn="true">
<param name="launchpath" value="/home/haypin/pytest/launchdir"/>
<rosparam command="load" file="$(find beginner_tutorials)/launch/mydict.yaml" />
<rosparam param="a_list">[3,1,4,1,5,9,2,6]</rosparam>
</node>
<!-- <node pkg="beginner_tutorials" type="SubYamlOrder.py" name="tacticSub" output="screen" respawn="true"/> -->
</launch>
ob_extract:
board:
adjacent_dis_min: 0.1
len:
min: 0.2
max: 0.3
if DEBUG:
param_ob_extract = rospy.get_param("~ob_extract") #~替代/node_name/,不用再加/
print(type(param_ob_extract)) #已经是个Python字典dict了