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

several catkin workspaces

asked 2014-06-27 12:47:11 -0500

courrier gravatar image

Hi all,

Is it possible to have several catkin workspaces and to source them sequentially in the .bashrc without conflict or may we experience issues with that?

source /ws1/devel/setup.bash
source /ws2/devel/setup.bash
source /ws3/devel/setup.bash
# ...

Thanks

edit retag flag offensive close merge delete

Comments

1

Effectively the last line will "overwrite" all previously sources workspaces. You should chain your workspaces on top of each other as described in the answer from @joq and only source the leaf workspace.

Dirk Thomas gravatar image Dirk Thomas  ( 2014-06-28 17:50:36 -0500 )edit

2 Answers

Sort by » oldest newest most voted
0

answered 2014-09-17 04:29:22 -0500

courrier gravatar image

For people having packages coming from different git/subversion repositories with their own file hierarchy not catkin-compliant and wanted to create several catkin workspaces because of these, I suggest to create a unique "central" catkin workspaces with symbolic links pointing to your git/svn repos, by this way you don't break the file hierarchy of your repos.

courrier@zbook:~/ros_ws/src$ ls -l
total 29
lrwxrwxrwx 1 courrier courrier   42 Sep 16 12:22 baxter_common -> /home/courrier/packages_ros/src/baxter_common/
lrwxrwxrwx 1 courrier courrier   48 Sep  9 19:25 CMakeLists.txt -> /opt/ros/hydro/share/catkin/cmake/toplevel.cmake
lrwxrwxrwx 1 courrier courrier   47 Sep 10 15:02 lemon_moveit_config -> /home/courrier/inria/asv1/src/lemon_moveit_config/
lrwxrwxrwx 1 courrier courrier   26 Sep 11 13:34 lemon_ros -> /home/courrier/university/lemon_ros/
[...]
edit flag offensive delete link more
2

answered 2014-06-27 13:31:13 -0500

joq gravatar image

Problems are likely to arise. That approach is not recommended.

What should work reliably is to create

  • ws1 as an overlay of /opt/ros/hydro.setup.bash (for example)
  • ws2 as an overlay of ws1
  • ws3 as an overlay of ws2

Then, source /ws3/devel/setup.bash.

edit flag offensive delete link more

Comments

Oops. This might explain some problems I've been having. Thanks, ROS Answers!

Kurt Leucht gravatar image Kurt Leucht  ( 2014-07-03 16:22:19 -0500 )edit

I'm following the tutorial about how to create a proper overlay (http://wiki.ros.org/catkin/Tutorials/workspace_overlaying) but I don't get it. What do they do different from me with my 3 "source"? I don't have this message "This workspace overlays blablabla" so I'm missing something but what?

courrier gravatar image courrier  ( 2014-07-23 07:18:54 -0500 )edit

I don't think the documentation is very clear about this. What I posted is the recommended solution. Maybe others can explain why.

joq gravatar image joq  ( 2014-07-23 08:47:24 -0500 )edit

That is what I wanted to do, but how do you create an overlay, then? I found out that tutorial above and... apparently what it does is only sourcing all setup.bash in the right order. Isn’t it what I was doing in my initial post?

courrier gravatar image courrier  ( 2014-07-23 09:20:51 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2014-06-27 12:47:11 -0500

Seen: 6,565 times

Last updated: Sep 17 '14