0

Rosanswers logo

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
catkin_init_workspace

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:

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

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?


Originally posted by pitosalas on ROS Answers with karma: 628 on 2017-07-25

Post score: 0


Original comments

Comment by gvdhoorn on 2017-07-25:
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.

Comment by allenh1 on 2017-07-25:
@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.

Comment by pitosalas on 2017-07-25:
@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!

Comment by jayess on 2017-07-25:
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 ...?

Comment by gvdhoorn on 2017-07-25:
Just a quick comment: there is no nesting of workspaces. Only layering.

Comment by pitosalas on 2017-07-25:
@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?

Comment by jayess on 2017-07-25:
I believe @gvdhoorn is referring to overlaying, but I could be wrong.

Comment by jayess on 2017-07-25:
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).

Comment by pitosalas on 2017-07-25:
Look at the update in my question: my reference about nesting is strictly about the directory structure. I am trying to understand what it means with respect to the code. I think perhaps your answer indirectly answers me.

pitosalas
  • 465
  • 4
  • 10

1 Answers1

0

Rosanswers logo

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.


Originally posted by jayess with karma: 6155 on 2017-07-25

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by pitosalas on 2017-07-26:
Thanks to everyone!