1,安裝qt的Qt Creator Plug-in 插件。(學會新建ROS工程、RUN配置等)
2,Setup Ubuntu to allow debugging/ptrace (網址https://ros-qtc-plugin.readthedocs.io/en/latest/_source/Setup-Qt-Creator-for-ROS.html#setup-ubuntu-to-allow-debugging-ptrace)
a,Open file: sudo gedit /etc/sysctl.d/10-ptrace.conf
b,
Change the value of kernel.yama.ptrace_scope
to 0
c,Reload the kernel configuration with "sudo systemctl restart procps.service"
3,Attach to a unstarted process (https://ros-qtc-plugin.readthedocs.io/en/latest/_source/Debugging-Catkin-Workspace.html)
- Next in Qt Creator browse to the file you wish to debug and insert break points.
- Menu Bar > Debug > Start Debugging > Attach to Unstarted Application...
- Browse to the executable then select Start Watching. (可執行文件在devel/lib下)
- Now run your project. Ctrl + R (在QT中添加一個ROS RUN STEP)
- Now depending on where the breakpoints were placed in qt, it should be stopped at a break point when it reaches one.