Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You have an issue because you can't give the yaml file as an argument in the node tag. As discussed in #q274609, you have to modify your launch file like this model (the arg part isn't mandatory but useful if you have to incluide your launchfile in another one) :

<launch>
    <arg name="file_name" default="$(find my_package)/my_yaml.yaml"/>   
    <rosparam command="load" file="$(arg file_name)"/>
</launch>

So in your case it should look like this :

<launch>
   <node name="SLAM" pkg="SLAM" type="SLAM">
    <rosparam command="load" file="$(find YOUR_PACKAGE_NAME_WITH_DATA_FOLDER)/Data/Asus.yaml"/>
    <rosparam command="load" file="$(find YOUR_PACKAGE_NAME_WITH_DATA_FOLDER)/Data/ORBvoc.yaml"/>
   </node>
</launch>

Note 1 : You can add the rosparam tags outside the node tag if you want to share your parameters with other nodes.

Note 2 : If you didn't notice, I changed ORBvoc.txt to ORBvoc.yaml. I don't know what your txt file is but if you have to load parameters from this file too you can't pass another file than a yaml one so you'll have to change your file extension to yaml, see #q12284.

You have an issue because you can't give the yaml file as an argument in the node tag. As discussed in #q274609, you have to modify your launch file like this model (the arg part isn't mandatory but useful if you have to incluide include your launchfile in another one) :

<launch>
    <arg name="file_name" default="$(find my_package)/my_yaml.yaml"/>   
    <rosparam command="load" file="$(arg file_name)"/>
</launch>

So in your case it should look like this :

<launch>
   <node name="SLAM" pkg="SLAM" type="SLAM">
    <rosparam command="load" file="$(find YOUR_PACKAGE_NAME_WITH_DATA_FOLDER)/Data/Asus.yaml"/>
    <rosparam command="load" file="$(find YOUR_PACKAGE_NAME_WITH_DATA_FOLDER)/Data/ORBvoc.yaml"/>
   </node>
</launch>

Note 1 : You can add the rosparam tags outside the node tag if you want to share your parameters with other nodes.

Note 2 : If you didn't notice, I changed ORBvoc.txt to ORBvoc.yaml. I don't know what your txt file is but if you have to load parameters from this file too you can't pass another file than a yaml one so you'll have to change your file extension to yaml, see #q12284.