ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Adding more than one path to ROS_PACKAGE_PATH?

asked 2011-10-07 00:52:22 -0600

jlo gravatar image

updated 2014-01-28 17:10:31 -0600

ngrennan gravatar image

Hi there, I have the following problem when I try to add more than one path to my ROS_PACKAGE_PATH in my .bashrc. Like this it won't cause any problems

export ROS_PACKAGE_PATH=/home/alonsoj1/ros_workspace/:$ROS_PACKAGE_PATH

but when I try to include more than one, f.i.:

export ROS_PACKAGE_PATH=/home/alonsoj1/ros_workspace/:/home/alonsoj1/ros/

it doesn't work and this is the kind of messages I get when I try to rosmake something:

alonsoj1@aut-228:~/ros_workspace/beginner_tutorials$ rosrun beginner_tutorials talker.py Traceback (most recent call last): File "/home/alonsoj1/ros_workspace/beginner_tutorials/nodes/talker.py", line 2, in <module> import roslib; roslib.load_manifest('beginner_tutorials') File "/opt/ros/electric/ros/core/roslib/src/roslib/launcher.py", line 75, in load_manifest sys.path = prefix + _generate_python_path(package_name, [], os.environ) + sys.path File "/opt/ros/electric/ros/core/roslib/src/roslib/launcher.py", line 131, in _generate_python_path raise roslib.packages.InvalidROSPkgException("While loading package '%s': %s"%(d.package, str(e))) roslib.packages.InvalidROSPkgException: While loading package 'std_msgs': Cannot locate installation of package std_msgs: [rospack] couldn't find package [std_msgs]. ROS_ROOT[/opt/ros/electric/ros] ROS_PACKAGE_PATH[/home/alonsoj1/ros/stacks:/home/alonsoj1/ros_workspace]

Also, when I try to self-complete (with TAB, I mean), I get something like this (FIXED, I had two trailing slashes at the end of the paths, I would have never guessed it would have mattered):

roscd beg[rospack] warning: trailing slash found in ROS_PACKAGE_PATH [rospack] warning: trailing slash found in ROS_PACKAGE_PATH [rosstack] warning: trailing slash found in ROS_PACKAGE_PATH [rosstack] warning: trailing slash found in ROS_PACKAGE_PATH

Any ideas? Thanks!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
7

answered 2011-10-07 01:03:57 -0600

It is important that you keep the original value of ROS_PACKAGE_PATH, i.e. never omit the trailing :$ROS_PACKAGE_PATH when redefining the variable:

export ROS_PACKAGE_PATH=/home/alonsoj1/ros_workspace:/home/alonsoj1/ros:$ROS_PACKAGE_PATH

Also, your paths should not end with a slash, i.e. write /home/alonsoj1/ros instead of /home/alonsoj1/ros/

edit flag offensive delete link more

Comments

1
Nice, same answer 3 minutes apart!
Lorenzo Riano gravatar image Lorenzo Riano  ( 2011-10-07 01:06:07 -0600 )edit
5

answered 2011-10-07 01:01:30 -0600

updated 2011-10-07 01:02:23 -0600

You should try:

export ROS_PACKAGE_PATH=/home/alonsoj1/ros_workspace:/home/alonsoj1/ros:$ROS_PACKAGE_PATH

this will do it

edit flag offensive delete link more

Comments

Seems we have a talent for simultaneous answering. :-)
roehling gravatar image roehling  ( 2011-10-07 01:06:00 -0600 )edit
1
And simultaneous commenting!
Lorenzo Riano gravatar image Lorenzo Riano  ( 2011-10-07 01:06:51 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2011-10-07 00:52:22 -0600

Seen: 11,593 times

Last updated: Oct 07 '11