ros2_rust icon indicating copy to clipboard operation
ros2_rust copied to clipboard

Debug rust app + ROS2 with VSCode

Open George-Gi opened this issue 9 months ago • 1 comments

I am trying to debug my rust app with VSCode, I have setup the launch.json file like I would usually do. If I create a simple rust application debugging works as expected. When I try to debug my rust app that is using the ROS2 rust stuff, it looks like the debug symbols can't be found. I set breakpoints and they can't be resolved. In the debug configuration I pass the required environment variables that are generated during sourcing the ROS workspace. Any experience with that or any suggestions?

George-Gi avatar May 08 '25 09:05 George-Gi

You can try use this ros2rs devcontainer configration and add relevant configuration in .cargo/config.toml or Cargo.toml

For example, i add this config to my Cargo.toml:

[patch.crates-io]
rclrs = { path = "rs_dep/install/rclrs/share/rclrs/rust" }
rosidl_runtime_rs = { path = "rs_dep/install/rosidl_runtime_rs/share/rosidl_runtime_rs/rust" }
builtin_interfaces = { path = "rs_dep/install/builtin_interfaces/share/builtin_interfaces/rust" }
std_msgs = { path = "rs_dep/install/std_msgs/share/std_msgs/rust" }
ros2_tools = { path = "rs_ws/install/ros2_tools/share/ros2_tools/rust" }
geometry_msgs = {path = "/home/dev/ros_ws/rs_dep/install/geometry_msgs/share/geometry_msgs/rust" }

f3rmata avatar Oct 08 '25 08:10 f3rmata