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

Nesting of workspaces

asked 2017-07-25 07:29:33 -0600

pitosalas gravatar image

updated 2017-07-25 21:36:49 -0600

I am following an example in the book "Programming Robots with ROS" from OReilly. Here's a snippet:

mkdir -p ~/wanderbot_ws/src
cd ~wanderbot_ws

Ok, so I understand that wanderbot_ws is now a valid catkin workspace. Next I did:

catkin create_pkg

At which point I have a directory structure that looks like this:

├── CMakeLists.txt -> /opt/ros/kinetic/share/catkin/cmake/toplevel.cmake
└── src
    └── wanderbot
        ├── CMakeLists.txt
        ├── package.xml
        └── src

There is a TON of documentation on catkin, and I've looked at a lot of it, but the big picture is still not so clear to me, so here are some detailed questions:

To me this directory structure shows a clear nested structure, even if it's only one level. wanderbot_ws/ contains a file called CMakeLists.txt and a directory called src. wanderbot/also contains a CMakeLists.txt and a src/ directory. Does it make any sense to have another directory under wanderbot, again containing a CMAkeLists.txt and a src/ subdirectory?

I think the answer is no, that the top level is a workspace and the second level is a package and that's where it stops.

p.s. what is the mythology behind the name catkin?

edit retag flag offensive close merge delete


Probably not what you want to hear, but I think the catkin page on the ROS wiki has quite some docs on this.

As to where catkin comes from, see wiki/catkin/conceptual_overview.

gvdhoorn gravatar image gvdhoorn  ( 2017-07-25 07:49:29 -0600 )edit

@pitosalas A catkin is a bud on a willow tree (in ROS 2, the build system is named ament, which is defined as "a catkin."). Put simply, the name is a nod to Wiillow Garage, and hints some about the developmentprocess: your package is budding in the catkin stage, then it blooms when it releases.

allenh1 gravatar image allenh1  ( 2017-07-25 13:00:49 -0600 )edit

@gvdhoorn thanks... but I've read a lot of that and it's hard to see the forest for the trees. I've added some more detailed questions in the original @allenh1 Thanks!

pitosalas gravatar image pitosalas  ( 2017-07-25 16:20:53 -0600 )edit

What do you mean by "does the nesting structure go down indefinitely?" As in, catkin workspace within a catkin workspace within a catkin workspace within a ...?

jayess gravatar image jayess  ( 2017-07-25 16:34:44 -0600 )edit

Just a quick comment: there is no nesting of workspaces. Only layering.

gvdhoorn gravatar image gvdhoorn  ( 2017-07-25 16:39:47 -0600 )edit

@jayless: I mean that literally in the folder structure I see a repeating structure of directories, recursive. My example is 2 levels deep. Can it be more? @gvdhoorn: can you clarify what you mean by layering? You mean that there's no inheritance from the containing dir to the contained dir?

pitosalas gravatar image pitosalas  ( 2017-07-25 16:41:44 -0600 )edit

I believe @gvdhoorn is referring to overlaying, but I could be wrong.

jayess gravatar image jayess  ( 2017-07-25 16:44:21 -0600 )edit

I'm still not quite clear on that question. You can have as many directories as you want, but no nested workspaces. You have packages within the (source space of the) workspace. But, even then you don't have packages within packages (except for a metapackage).

jayess gravatar image jayess  ( 2017-07-25 16:50:33 -0600 )edit

1 Answer

Sort by » oldest newest most voted

answered 2017-07-25 22:55:52 -0600

jayess gravatar image

updated 2017-07-25 23:04:52 -0600

If you're talking about a package within a package then it does not make sense to have a 3rd level. Like you said, wanderbot_ws is your catkin_workspace and wanderbot is the ROS package. Packages are not nested within other packages, as @gvdhoorn mentioned in a comment to your question.

The only time that you would "nest" a package within a package is with a metapackage. And the reason to do that is for logical organization of packages and to make installation of these packages easier as a distribution via apt-get or some other method.

edit flag offensive delete link more


Thanks to everyone!

pitosalas gravatar image pitosalas  ( 2017-07-26 08:14:49 -0600 )edit

Question Tools

1 follower


Asked: 2017-07-25 07:29:33 -0600

Seen: 966 times

Last updated: Jul 25 '17