ROS 파라미터 네임스페이스

OpenJR·2022년 11월 16일
0

config/.yaml파일을 만들고 런치파일에서 파라미터들을 불러오는 경우 네임스페이스를 만들 수 있다.

Config 파일

PARAM:
  A: 3
  B: 5

있는 경우

런치파일

<launch>
    <node pkg="nh_test" type="nh_test_node" name="test_node" output="screen" >
        <rosparam file="$(find nh_test)/config/config.yaml" command="load"/>
    </node>
</launch>

파라미터 불러오는 함수

nh_.getParam(ros::this_node::getName() + "/PARAM/A", a);

없는 경우

런치파일

<launch>
    <node pkg="nh_test" type="nh_test_node" name="test_node" output="screen"/>
    <rosparam file="$(find nh_test)/config/config.yaml" command="load"/>
</launch>

파라미터 불러오는 함수

nh_.getParam("/PARAM/A", a);

profile
Jacob

0개의 댓글