ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

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:

/home/catkin_ws_A/devel/etc
/home/catkin_ws_A/devel/include
/home/catkin_ws_A/devel/lib
/home/catkin_ws_A/devel/share
/home/catkin_ws_B/devel/etc
/home/catkin_ws_B/devel/include
/home/catkin_ws_B/devel/lib
/home/catkin_ws_B/devel/share
/opt/ros/hydro/bin
/opt/ros/hydro/etc
/opt/ros/hydro/include
/opt/ros/hydro/lib
/opt/ros/hydro/share

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

Any help would be appreciated

Marcus

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

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

Comments

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

Marcus gravatar image Marcus  ( 2015-01-21 03:32:50 -0500 )edit

Question Tools

1 follower

Stats

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

Seen: 108 times

Last updated: Jan 20 '15