Guide for ROS2/colcon project in CLion
Is there a guide for using CLion IDE to build/debug ROS2 with colcon on a mixed python/CPP project? CLion was awesome for this with ROS1 projects, for source level debugging with variable watch/modify and using IntelliJ for project navigation and refactoring. I want to get away from any ROS1/catkin/ament stuff and I do not understand the colcon/CMake/make toolchain or the CLion configuration enough to tackle it.
An example using the standard ROS tutorials/example projects would be terrific since I already know that I can build those using colcon build.
One plausible workaround would be to have colcon build generate a top level CMakeLists.txt file? If that is indeed possible then CLion may be able to open the project that way (that worked for ROS1)
Eventually I would like to be able to use Docker environments to assist with collaborative development but I am not interested in that extra layer just yet.
ENV Info: Ubuntu 18.04.3 x64 Kernel 5.3.0-40-generic CLion 19.3.4 ROS2 Eloquent
I also have a similar support request open at JetBrains: https://youtrack.jetbrains.com/issue/...
catkin_make_isolated
/catkin_tools
/colcon
/ ROS 2 conceptionally all don't support a workspace-level CMake file since that approach doesn't work on a larger scale (see http://design.ros2.org/articles/ament...).I have never used CLion before. Maybe this (https://www.jetbrains.com/help/clion/...) approach can be helpful. There is a PR to
colcon-cmake
to generate a workspace-level compilation database, see https://github.com/colcon/colcon-cmak....Thank you both for the links. I tried to use Compilation Database in CLion, but it can be used now only to check compilation errors. It can't build and can't show cmake issues.
Also I tried previous approach with single cmake, indeed, it is not supported at all. I gave up when trying to depend on custom messages from the same workspace.
People suggest to use VCode for ROS2, but it's the last thing I want to try...