Ask Your Question
0

Why can't ROS find this file?

asked 2016-08-12 15:27:14 -0500

jacksonkr_ gravatar image

#Error

error loading <rosparam> tag: 
    file does not exist [costmap_common_params.yaml]
XML is <rosparam command="load" file="costmap_common_params.yaml" ns="global_costmap"/>
The traceback for the exception was written to the log file

I tried putting the files in the same folder as the launch file and that didn't work. Scanning around my hard drive I found the file located at ~/catkin_ws/src/rtabmap_ros/launch/azimut3/config/costmap_common_params.yaml

What's going on here?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2016-08-12 15:54:16 -0500

ahendrix gravatar image

updated 2016-08-12 15:54:54 -0500

The file parameter to rosparam needs an absolute file name (technically it's relative to the working directory for roslaunch, but you shouldn't count on that).

You can give the file parameter an absolute path by using the $(find pkg) substitution to start with the absolute path to a package, and then use the path of the file within that package.

Since you're looking for the config/costmap_common_params.yaml file within the azimut3 package, you can refer to that file relative to the azimut3 package:

<rosparam command="load" file="$(find azimut3)/config/costmap_common_params.yaml" ns="global_costmap"/>

for more substitutions and examples, have a look at the roslaunch XML syntax documentation

edit flag offensive delete link more

Comments

ResourceNotFound: azimut3 so I found another copy of the file at ~/catkin_ws/install/share/rtabmap_ros/launch/config/costmap_common_params.yaml and changed the file reference to $(find rtabmap_ros) but ROS is looking in /home/ubuntu/catkin_ws/src/rtabmap_ros/launch/config/ instead. ??

jacksonkr_ gravatar image jacksonkr_  ( 2016-08-13 11:19:30 -0500 )edit

If you want to use the install location ~/catkin_ws/install/ you should source that setup.bash file. i.e. source ~/catkin_ws/install/setup.bash

Michael Johnson gravatar image Michael Johnson  ( 2016-08-15 11:34:53 -0500 )edit

Can you find the azimut3 package with rospack find azimut3? If you can't, you should figure out why and fix that. Perhaps there isn't a package.xml in your azimut3 package, or it doesn't have the right package name in it?

ahendrix gravatar image ahendrix  ( 2016-08-17 13:14:24 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-08-12 15:27:14 -0500

Seen: 1,666 times

Last updated: Aug 12 '16