Ask Your Question

ROS_PACKAGE_PATH environment

asked 2013-05-10 04:46:17 -0500

Zayin gravatar image

updated 2014-01-28 17:16:29 -0500

ngrennan gravatar image


I'm trying to set my ROS_PACKAGE_PATH variable permanently. I appended the following line to the etc/environment file: ROS_PACKAGE_PATH="/home/zayin/catkin_ws/src:/opt/ros/groovy/share:/opt/ros/groovy/stacks". Then, I logged out and back in. However, when I type echo $ROS_PACKAGE_PATH in the terminal, I get /opt/ros/groovy/share:/opt/ros/groovy/stacks, which is the initial setting. What have I forgotten to do? Thanks!

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2013-05-10 06:18:41 -0500

Souldier gravatar image

updated 2013-05-10 06:19:23 -0500

Similar questions/answers exist - see here, here.

Unless you add your workspace to the package path in your ~/.bashrc file, each time you open a new terminal you will need to source your workspace (see this tutorial).

To set your workspace permanently, open your .bashrc file in a text editor, for example -- gedit ~/.bashrc -- and add

export ROS_PACKAGE_PATH=/your/path/to/workspace:$ROS_PACKAGE_PATH

at the bottom of your file. Obviously, make sure you change "/your/path/to/workspace" to your exact workspace path..

edit flag offensive delete link more


Thanks! I got it to work thanks to these topics!

Zayin gravatar image Zayin  ( 2013-05-10 06:43:46 -0500 )edit

I don't understand the last part :$ROS_PACKAGE_PATH Should it be like this ROS_PACKAGE_PATH=/home/hjt/catkin_ws/src:$ROS_PACKAGE_PATH

RosUser gravatar image RosUser  ( 2016-01-25 16:26:59 -0500 )edit

The ":$ROS_PACKAGE_PATH" means that you are adding "/home/hjt/catkin_ws/src" to the start of the ROS_PACKAGE_PATH, whereas if you just did "export ROS_PACKAGE_PATH=..." then the new ROS_PACKAGE_PATH would overwrite the existing path.

bemery94 gravatar image bemery94  ( 2017-02-05 17:23:30 -0500 )edit

answered 2013-05-10 05:18:42 -0500

updated 2013-05-10 05:49:48 -0500

May be you have defined ROS_PACKAGE_PATH in your ~/.bashrc file or you are sourcing other file after defining this variable. Look for something like source /opt/ros/groovy/setup.bash.

edit flag offensive delete link more


I just checked, and no, it's not there. Any other file I should check?

Zayin gravatar image Zayin  ( 2013-05-10 05:23:10 -0500 )edit

check the answer.

gustavo.velascoh gravatar image gustavo.velascoh  ( 2013-05-10 05:51:18 -0500 )edit

There's nothing like source /opt/ros/groovy/setup.bash in ~/.bashrc.

Zayin gravatar image Zayin  ( 2013-05-10 05:56:46 -0500 )edit

can you post the content of .bashrc?

gustavo.velascoh gravatar image gustavo.velascoh  ( 2013-05-10 06:28:22 -0500 )edit

I finally got it to work by adding "source ~/catkin_ws/devel/setup.bash" at the end of the file. Echo works fine and I can use rosrun right after opening my terminal. Thanks for your help!

Zayin gravatar image Zayin  ( 2013-05-10 06:44:57 -0500 )edit

can u tell me what exactly have u done?

Robertspilac gravatar image Robertspilac  ( 2020-02-17 21:31:15 -0500 )edit

answered 2013-07-01 01:29:53 -0500

This is helpful, thanks a lot

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools



Asked: 2013-05-10 04:46:17 -0500

Seen: 24,018 times

Last updated: Jul 01 '13