使用qt開發ROS程序,並能夠用debugging

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

  1. Next in Qt Creator browse to the file you wish to debug and insert break points.
  2. Menu Bar > Debug > Start Debugging > Attach to Unstarted Application...
  3. Browse to the executable then select Start Watching.  (可執行文件在devel/lib下)
  4. Now run your project. Ctrl + R (在QT中添加一個ROS RUN STEP)
  5. Now depending on where the breakpoints were placed in qt, it should be stopped at a break point when it reaches one.
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章