Ask Your Question

Unexpected behaviour of "source devel/setup.bash"

asked 2016-05-25 09:35:57 -0600

Behsad Ghanei gravatar image

OS: Ubuntu 14.04

ROS: Indigo Turtle

Bash: Terminator


I have encountered an undesirable behaviour while working with ROS related to sourcing workspaces. First of all I have two workspaces which contain similar packages. The workspaces are: ~/r2d2_CL/... and ~/c3po_CL/... . I had had no problems installing packages, launching nodes and so on, up until today.

Before, I could source either workspace with source devel/setup.bash while being in ~/r2d2_CL/... or ~/c3po_CL/... . As a result ROS_PACKAGE_PATH would contain the proper workspace in which I sourced.

But now something strange happens. Whenever I source now, in either workspace, ROS_PACKAGE_PATH contains both workspaces. The output of printenv | grep ROS is:


You can see, that both workspaces are sourced. This has undesirable effects. For example: When I work in ~/r2d2_CL/... and type in the terminal roslaunch vrmagic_camera camera.launch, ROS executes the launchfile which is located in the workspace ~/c3po_CL/... .

My questions regarding this problem are:

  1. How could this happen? Before the problem occured I have installed another package in the workspace ~/r2d2_CL/... . Nothing more.
  2. How can I revert this, so that sourcing will lead to one sourced (desired) workspace again.

Thanks in advance

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-05-25 09:50:41 -0600

gvdhoorn gravatar image

Could be that you inadvertently have built your c3po workspace while having sourced the other and vice versa.

Start a clean terminal, then remove the devel and build folders in both workspaces. Now source the distro setup.bash and rebuild c3po. In another terminal, the same with rd2d.

edit flag offensive delete link more


Thanks for the quick advice, I am going to try that out now.

Edit: It worked, I understood, what went wrong. Thank you!

Behsad Ghanei gravatar image Behsad Ghanei  ( 2016-05-25 09:51:41 -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: 2016-05-25 09:35:57 -0600

Seen: 388 times

Last updated: May 25 '16