1.3 KiB
1.3 KiB
Debug with VSCode
-
Install debugpy module
pip install debugpy -
Add to your code listening to the default
5678port with debug adapterimport debugpy debugpy.listen(5678, in_process_debug_adapter=True) -
Launch your G2O Server
-
In VSCode, go to your Python script, press F5 and select Attach using Process ID
-
Find G2O Server process and select it
!!! warning Sometimes debugpy isn't terminating process even after server is closed. Keep an eye on process list while attaching, so you can terminate them manually.
Debug with PDB
Python Debugger (PDB) is already implemented by default, so you can place breakpoints right away
@g2o.event('onTime')
def evtTime(**kwargs):
a = 5
b = 246
c = a * b
breakpoint()
print(kwargs)
That way PDB interface will show up on breakpoint encounter, and you can use it as usual



