Rosanswers logo

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

Originally posted by Behsad Ghanei on ROS Answers with karma: 13 on 2016-05-25

Post score: 1


1 Answer 1


Rosanswers logo

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.

Originally posted by gvdhoorn with karma: 86574 on 2016-05-25

This answer was ACCEPTED on the original site

Post score: 2

Original comments

Comment by Behsad Ghanei on 2016-05-25:
Thanks for the quick advice, I am going to try that out now.

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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.