ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I agree with @gvdhoorn about avoiding relative path names. The trick is to use rospkg to construct a path relative to your package directory, something like this (untested):
import os, rospkg
rp = rospkg.RosPack()
script_path = os.path.join(rp.get_path("your_package"), "src", "script_name")