Guide for ROS2/colcon project in CLion

asked 2020-03-25 18:18:11 -0500

Ciel gravatar image

updated 2020-03-26 14:38:38 -0500

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:

edit retag flag offensive close merge delete


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

Dirk Thomas gravatar image Dirk Thomas  ( 2020-03-26 14:46:37 -0500 )edit

I have never used CLion before. Maybe this ( approach can be helpful. There is a PR to colcon-cmaketo generate a workspace-level compilation database, see

Dirk Thomas gravatar image Dirk Thomas  ( 2020-03-26 14:48:26 -0500 )edit