ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

ROS_PACKAGE_PATH erased every time I source devel/setup.bash

asked 2019-02-21 09:40:28 -0600

Poutchi gravatar image

updated 2019-02-21 09:40:47 -0600


I need your help on what appears like a bug in catkin. I have two workspaces

  • catkin_ws1 contains :
    • pkg1
    • pkg2
  • catkin_ws2 contains :
    • pkgA
    • pkgB

If I source the setup of catkin_ws1 and echo ROS_PACKAGE_PATH everything works as expected

cd ~/catkin_ws1
source deve/setup.bash

When I source the setup of the second workspace catkin_ws2 the old ROS_PACKAGE_PATH is erased

cd ~/catkin_ws2
source deve/setup.bash

I lose the ~/catkin_ws1/src/pkg1:~/catkin_ws1/src/pkg2

Is there a problem in my configuration or is it an issue related to catkin ?


  • catkin_tools 0.4.4
  • Python 2.7.12
  • GCC 5.4.0
  • ros kinetic


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-02-21 10:16:55 -0600

Dirk Thomas gravatar image

There is no problem and what you see is intentional behavior. Assuming that you have build catkin_ws2 without catkin_ws1 being source before.

When you source a workspaces setup file you will get the environment available at its build time + the environment for that workspace.

See for a similar question which describes a workaround (sourcing the second workspace with the option --extend) but also mentioning the potential pitfalls.

edit flag offensive delete link more


Thank you for your clear answer.

Poutchi gravatar image Poutchi  ( 2019-02-22 02:58:06 -0600 )edit

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: 2019-02-21 09:40:28 -0600

Seen: 177 times

Last updated: Feb 21 '19