Can someone teach me how to love ROS2?
... Or, at least, like it? ... Or, at the very least, not hate it?
I've worked with ROS2 for about a year now, but, to be honest, I hate it... I really like the concept of having communicating nodes, but too often I get frustrated by, in my eyes, stupid design choices made by the ROS2 developers, which make me think "If they had done it this-and-that way, everything would have been so much easier". I think my frustration might be relieved a lot if I understand why certain choices were made. I'm using ROS2 Galactic on Linux, programming only in C++. I consider myself a good programmer (for non-ROS stuff, that is :-) ). I had no prior experience with ROS.
I think that almost all of my questions boil down to one single question:
- Why is ROS2 not just a normal library that you can include in your own project (e.g., like SDL)?
(plus some binaries for things like inspection etc, likeros2 topic
)
Just add-lROS2
to your link options and you're done (and you have none of the frustrations listed below)...
Or, more closely related to some of the specific frustrations I have:
Why is everything structured into packages? To group related parts belonging to one project? If so, then why should custom messages be in a separate package1? (and why do all .cpp files for all executables mix up in the
src
directory2?Why do you need a separate build tool (
colcon
) to compile ROS2 stuff? Why isn't justmake
orcmake
good enough? This makes it extra challenging to integrate into an IDE (depending on which IDE of course).Why is compiling so terribly slow? On a new laptop it takes 6 seconds to compile just a 100 line program (normal gcc would take only the blink of an eye). This is especially annoying when developing on a Raspberry Pi, which creates even longer compile times.
Why does it take more than 100 files in the install directory to just supply one executable?
Why isn't it possible to build and run your program in the same terminal?
Why is it necessary to
. install/local_setup.sh
?Why can't I just run my own executable instead of leaving it to
ros2 run
to execute it?Why is it so hard to configure the project (CMakeLists.txt + package.xml)? I only can get them right by heavy googling and trial-and-erroring the suggestions from forums. Error messages are too cryptic or don't relate to the actual problem and the building process sometimes just stops working after having worked for several days (seemingly without any good reason).
I guess that there's a good reason for all of the above questions, which outweighs the burden of the extra complexity introduced (when compared to just being a simple library as described abobve). I hope that, by understanding these reasons, I will appreciate the design decisions more, and hopefully start to like or love ...