- Attach the gdb debugger with the launch file as follows:
<launch> <node pkg=""chapter4_tutorials"" type=""program1"" name=""program1"" output=""screen"" launch-prefix=""xterm -e gdb --args""/> </launch>
- Start the ROS node within gdb debugger using the launch command:
$ roslaunch chapter4_tutorials program1_gdb.launch
- Create a new xterm terminal with the node attached to gdb, as shown in the following screenshot.
Moreover, we can set breakpoints if needed and then press the c or r key to run the node and debug it. The source code can be listed by using the l command:
ROS node with gdb debugger
- Try debugging python in ...