You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have difficulties attaching to a process of a python node in a combined python and C++ package in Ros2, using the tools given in vscode-ros. That is why I present this approach using the python debugger provided by vscode.
There are different templates and tutorials about how to create the combined package:
In my case, I am using the approach proposed by roboticsbackend.
Use the default python debugger
I found this solution that I want to share here, for other developers that found it helpful. A python node can be launched or debugged using the configuration given by vscode: https://code.visualstudio.com/docs/python/debugging
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Background
I have difficulties attaching to a process of a python node in a combined python and C++ package in Ros2, using the tools given in
vscode-ros
. That is why I present this approach using thepython debugger
provided by vscode.There are different templates and tutorials about how to create the combined package:
In my case, I am using the approach proposed by
roboticsbackend
.Use the default python debugger
I found this solution that I want to share here, for other developers that found it helpful. A python node can be launched or debugged using the configuration given by vscode: https://code.visualstudio.com/docs/python/debugging
Considerations:
colcon build --symlink-install
as explained in https://docs.ros.org/en/foxy/Tutorials/Colcon-Tutorial.htmlchmod +x scripts/py_node.py
Attach to a process
Configuration added in
.vscode/launch.json
:Launch the current file
Configuration added in
.vscode/launch.json
:Note the setting
"justMyCode":false
, to be able to step into scripts in different locations.Any comment or correction is welcome.
Beta Was this translation helpful? Give feedback.
All reactions