Rosanswers logo


There are multiple catkin workspaces on my station (from different users).

If I source the setup.bash of only my workspace in my .bashrc it still sources a couple of other workspaces. Or that's what I think since I can roscd into those packages as well as see it in my ROS_PACKAGE_PATH.

What is the reason for this?

Thank you

Originally posted by 2ROS0 on ROS Answers with karma: 1133 on 2014-10-24

Post score: 0

Original comments

Comment by al-dev on 2014-10-24:
If you reset ROS_PACKAGE_PATH and re-source ~/.bashrc, what do you get ? :

source ~/.bashrc

At least you will know exactly what comes from your .bashrc

Comment by 2ROS0 on 2014-10-24:
I did. I sourced /opt/ros/hydro/setup.bash. That makes ROS_PACKAGE_PATH have just the hydro default directories. And then I sourced the setup.bash from one of my workspaces devel space. And couple other workspaces are added along with that.

Comment by al-dev on 2014-10-24:
How about deleting your build/ and devel/ from that workspace and rebuilding the whole workspace?


1 Answer 1


Rosanswers logo

The behaviour your are observing has to do with how catkin workspaces are chained.

At the time you created your catkin workspace, other workspaces had already been created and sourced within the shell you were using.

A quick fix (if you only want to have the system-wide installed ROS packages and your catkin workspace sourced) is:

cd your_catkin_ws/
rm -rf build/ devel/
source /opt/ros/hydro/setup.bash

Then, remember to have only one line in your .bashrc:

source path_to_your_catkin_ws/devel/setup.bash

See the answers (particularly the second one) to this question for a more detailed explanation on how chaining of catkin workspaces actually works.

Originally posted by Murilo F. M. with karma: 806 on 2014-10-26

This answer was ACCEPTED on the original site

Post score: 5

Original comments

Comment by dornhege on 2014-10-27:
build and devel are usually not under src. I think it should also be sufficient to only delete build/devel, source the hydro/setup.bash and catkin_make.

Comment by Murilo F. M. on 2014-10-27:
You are right, there is no need to delete the CmakeLists.txt. Thanks for pointing that out. I'm editing my answer to remove those commands.


Your Answer

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