Ask Your Question

having to separate catking workspaces that do not interfere with each other

asked 2015-01-20 13:34:04 -0500

Marcus gravatar image

updated 2015-01-20 13:34:30 -0500

Hello everyone,

I have a simple problem. On my robot I have 2 catkin workspaces. Lets call them ws_A and ws_B. ws_A is used for execution of packages I have tested in ws_B. Now that means that I will end up having the same packages in ws_A as in ws_B sometimes. I was always under the impression that when I source the setup.bash of ws_A I am only going to access packages in ws_A even though there might be a package with the same name in ws_B. Through some try and error I found out that sometimes I am accessing packages from the wrong workspace. Is this normal? Is my assumption wrong and should I give packages in ws_A a different name than packages in ws_B?

Here is another thing that I find curious. When I do a catkin_find (although I have only sourced the setup.bash of ws_A) this is what I get:


Now I have also checked my bash.rc file but it is the correct workspace that I am sourcing

Any help would be appreciated


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-01-20 13:51:44 -0500

Dirk Thomas gravatar image

Whenever you build e.g. workspace B you must source your underlay workspace (/opt/ros/hydro) before.

If you have sourced workspace A that will result in chaining them.

To restart you probably want to remove the build / devel folder of both workspace and rebuild them with only the underlay being sourced.

edit flag offensive delete link more


Hey Dirk, as you said I deleted both /devel and /build, sourced the /opt/ros/hydro/setup.bash and finally catkin_make my package. After a last sourcing of the setup.bash in devel/ everything works as expected

Thanks for the fast answer and good explanation


Marcus gravatar image Marcus  ( 2015-01-21 03:32:50 -0500 )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

1 follower


Asked: 2015-01-20 13:34:04 -0500

Seen: 43 times

Last updated: Jan 20 '15