ros2 / ros2_documentation

ROS 2 docs repository
https://docs.ros.org/en/rolling
Creative Commons Attribution 4.0 International
535 stars 1.06k forks source link

Document editing/debugging process in VSCode for C++ and Python when developing with the standard ROS toolchain. #4766

Open Ryanf55 opened 1 week ago

Ryanf55 commented 1 week ago

Purpose

There are a few places to look on how to set up VSCode to debug C++ and Python while using a colcon workspace, but these could live with the ROS documentation. colcon and multi-project workspaces add complexity to the environment setup, so we should explain to users how to not let it get in the way of introspection.

Assumptions

C++

CMake Debugger

The visual CMake debugger in CMake 3.30 is awesome! But, it assumes you have a top level CMakeLists, or only one CMakeLists project. It's not clear, if you have a package that has a CMake configure error in a ROS workspace, how you get VScode to Configure with Debugger.

Intellisense

VSCode needs intellisense working, but we need to set up the include paths. When you add a new package to the workspace, intellisense needs to know about it. Let's document how to set that up.

GDB

Python

Debugger

Launch

Notes

References