Can I use a (more simplistic) compiler like MinGW to build ROS2(-packages)? What exactly does colcon do?
Hello!
I am looking into simply using the Publish and Subscribe functions from ROS, not specifically for a robot, but just for communication between different machines in my network. So I don't really need most of ROS2 functionality but mainly need to make use of the rclcpp lib.
I have been wondering if I can compile my code by just linking i.e. the rclcpp library with other compilers such as MinGW so that I don't have to set up such a "complex" environment with colcon etc. etc. Is possible to compile ROS2 with MinGW and if so, how?
If you just want to use publish and subscribe then using DDS directly (or, depending on your specific requirements, another middleware such as MQTT) would be easier than using ROS.
Why though? Setting up a basic publisher and subscriber is (code-wise) much easier by using ROS2 than using DDS directy. What makes using ROS for that purpose harder than using DDS?
Let's say I only want to compile the "demo_nodes_cpp" package with the msvc17 compiler (I am using QtCreator and qmake for this). I tried to do that but I get several LNK2019 errors as I am not sure which of the hundreds of .lib's in ros2/install/Lib to link to my project. Say, I know which libs to include, would I be able to compile everything?
The code may be simpler but you appear to be making life harder for yourself for compiling and linking. Plus you may make your resulting binaries larger too.
If you know what libraries to link against, then yes you can compile everything, just as with any software project. However the whole point of the tools we have for ROS is that we don't have to do that. While the information necessary, like
pkgconfig
files, is available, it's not the easiest route.I will first try my luck with finding the necessary libs. Maybe, during that process, I will convince myself to use plain DDS then, I'll see. Thank you!