ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Your file paths are probably relative, so they will be resolved against the current working directory (CWD
). The CWD
for ROS nodes is not the root of the packages that they are located in, but the $HOME/.ros
directory.
What is typically done in these cases is to use parameters to pass the absolute location of files to nodes, with the parameters getting set in a launch file. The launch file then allows you to use directives such as $(find ..)
, which will search for the package name that you give it, and return the absolute path to that.
See wiki/roslaunch/XML for more info on this. See wiki/roslaunch/XML - node - attributes for the cwd
attribute for nodes (but note that you cannot change it to any arbitrary path).