ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

I think I figured it out after looking at the arguments/options differences between catkin_tools and colcon.

Here is an example of what I did usingros2_example_ws, which is assumed to have been already cloned and built previously with just colcon build as specified in the Using Colcon to build packages Tutorial. My additional steps were:

From a terminal:

~/ros2_example_ws$ . install/setup.bash
~/ros2_example_ws$ colcon build --cmake-force-configure --cmake-args -G"Eclipse CDT4 - Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug

Then, from another terminal:

  • Source the workspace again (e.g. ~/ros2_example_ws$ . install/setup.bash)

  • launch eclipse (I haven't tried launching Eclipse outside of the terminal yet)

  • In Eclipse, do the Import > Existing Project and navigate to the project of interest (e.g. ~/ros2_example_ws/build/examples_rclcpp_minimal_subscriber/), and import this.

  • The executable will show in the Project's Binaries view, so the "node" can be run from there or modified within the Run/Debug Configurations as needed.

NOTE: The -DCMAKE_BUILD_TYPE=Debug in the --cmake-args is only needed if building with Debug flags is desired.