ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Here's an example in Python
from rospkg import RosPack
def find_abs_pkg_path(pkg_name):
"""Returns the absolute path of the package with name pkg_name."""
# Get an instance of RosPack with the default search paths
ros_pack = RosPack()
return ros_pack.get_path(pkg_name)
if __name__ == '__main__':
PKG_PATH = find_abs_pkg_path("my_package")
print "path of ROS package my_package", PKG_PATH