I always add in existing CmakeLists new packages, but I just follow the previous structure of the code and adding something to it is not that hard, but it is always error and trial.
Reading official docs is of course useful, but it doesn’t stick. I forget it immediately.
Is this just a skill issue, and I should invest more time in Cmake and “building”? How important it is to know every line of a CmakeList? Does it make sense concentrating on it specifically?
I think it’s worth understanding CMake. Everything needs to be built, so if you understand the build system you’ll spend more time thinking about the problem you’re solving instead of feeling interrupted by having to figure out how to build your code. That knowledge will also help you when it’s time to package and release your code.
I don’t know a good resource for getting started. I do see CMake has expanded their tutorials: CMake Tutorial — CMake 4.2.3 Documentation . I haven’t read the new ones myself.
CMake has been around a long time, so there are often multiple ways of doing things, and it’s not obvious what you should be using. Generally if you’re using targets and target-specific functions you’re doing it right.
The thing is that instead of working on controls and engineering, I’ll pay now attention to the Cmake. The thing is that when working on ros2 project in C++ 80-90% of time it takes to learn C++ specific concepts. Compile time, awful debug messages, strange and verbose modern C++ syntax, advanced macros, many and many exceptions to basic building blocks of the language, etc. When I look up the ros2control source code or when I dive one layer deeper in standard ros2 code for Node (or anything else) for example, it is almost never possible to see something completely familiar, there are always new pieces of syntax, abstractions and so on. The people that contribute to it are some kind of magicians to me. I can’t say that I am a total total beginner at this point, I have spent some good amount of time, and even though I enjoy the process, sometimes I think it is will never be enough and I am just getting sidetracked.
And then I remember that some people just use Matlab for everything, they don’t spend so much on the programming part of the project, but on a engineering/physics/math one. I enjoy working on linux and in open-source environment much more though.
Because ROS is federated, packages come from a lot of different people with different experience levels and preferences. I can’t find it, but there is a joke about everybody knowing 80% of C++, but a different 80%.
There are some very sharp folks in the robotics community, but I assure you that there are no magicians. Once again, you are seeing the product of many, many people who have different areas of expertise and experience contributing to different parts of the codebase. This is one reason that I love open source so much, I can focus on building on the places I understand and care about, but trust that other people are doing the same in other areas. I don’t think that I could build nav2 or moveit myself, but I am super grateful that there are others out there building them.
Happy to have you around, and hope that you can find a way to contribute!