首页 > 系统相关 >ubuntu 16.04 vs code中调试ORB-SLAM3

ubuntu 16.04 vs code中调试ORB-SLAM3

时间:2022-09-01 19:00:30浏览次数:107  
标签:... code 16.04 json SLAM3 build ORB 调试

如果是在vs code中编译,在vs code中调试,那么执行如下,如果还是在终端中编译,只在vscode中调试,那么应该可以忽略(1-3)

注意

修改build.sh文件中最下面的DCMAKE_BUILD_TYPE为Debug,如果没改加不了断点

(1) 创建c_cpp_properties.json

ctrl + shift + P后输入C/C++: Edit configurations,其中内容可以先保持默认的不做修改。

(2) 创建tasks.json

ctrl + shift + P后输入Tasks: Configure Tasks

内容改为

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build",
            "type": "shell",
            "command": "./build.sh",
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}

(3) 编译

ctrl + shift + P后输入Tasks: Run Build Task或者快捷键ctrl + shift + B,就可以运行build.sh文件(执行tasks.json中的command指令)。


(4) 调试。快捷键Ctrl+Shift+D,打开一个launch.json。修改为
```c
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "g++ - 生成和调试活动文件",
            "type": "cppdbg",
            "request": "launch",
            "program": "/...存放的路径.../ORB_SLAM3/Examples/Monocular/mono_euroc",
            "args": ["/...存放的路径.../ORB_SLAM3/Vocabulary/ORBvoc.txt",
                     "/...存放的路径.../ORB_SLAM3/Examples/Monocular/EuRoC.yaml",
                     "/...存放的路径.../ORB_SLAM3/Examples/Monocular/dataset/MH04",
                     "/...存放的路径.../ORB_SLAM3/Examples/Monocular/EuRoC_TimeStamps/MH04.txt"
                     ],
            "stopAtEntry": false,
            "preLaunchTask": "build",//这一步的build与tasks.json中的type名字相同
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "为 gdb 启用整齐打印",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        }
    ]
}

然后按左上角的g++前面的蓝色三角按钮,即可进行调试

参考
https://blog.csdn.net/weixin_45834800/article/details/125092249

标签:...,code,16.04,json,SLAM3,build,ORB,调试
From: https://www.cnblogs.com/vivian187/p/16647547.html

相关文章

  • Educational Codeforces Round 134 (Rated for Div. 2)
    DMaxiumAnd贪心,优先满足高位,每次判断是否能够满足这一位答案为1,如果能则更新答案,这样显然是优的EPrefixFunction模仿求前缀函数的算法,先预处理求出\(|S|\)的前缀函......
  • AutoNumber VsCode插件开发
    AutoNumberVsCode插件开发:::details目录目录AutoNumberVsCode插件开发Step.2:安装脚手架Step.3:创建空项目Step.4:打包发布Step.5:本地打包Step.6:上传vs......
  • [Google] LeetCode 150 Evaluate Reverse Polish Notation
    EvaluatethevalueofanarithmeticexpressioninReversePolishNotation.Validoperatorsare+,-,*,and/.Eachoperandmaybeanintegeroranotherexpres......
  • 生成二维码并以图片格式下载-qrcodejs2
    1、安装qrcodejs2npminstallqrcodejs2--save2、在需要的页面引入importQRCodefrom"qrcodejs2";3、页面中使用<divid="qrcode"ref="qrcode"></div>4......
  • letcode算法--5.整数反转
    给你一个32位的有符号整数x,返回将x中的数字部分反转后的结果。如果反转后整数超过32位的有符号整数的范围 [−231, 231 −1],就返回0。假设环境不允许存储......
  • Educational Codeforces Round 134 (Rated for Div. 2)
    EducationalCodeforcesRound134(RatedforDiv.2)目录EducationalCodeforcesRound134(RatedforDiv.2)D.MaximumANDE.PrefixFunctionQueriesD.Maximum......
  • 记一次feign调用报错:feign.codec.DecodeException: Error while extracting response
    一直以为是被调用法的返回对象类型和调用方接收的对象类型不一致导致的解析失败甚至以为无法传递除Jsondate以外的类型 实际问题:多服务调用导出用到多线程token无法......
  • vscode 配置 plantuml
    官网:https://plantuml.com/zh/1.JDK下载安装https://www.oracle.com/java/technologies/javase-downloads.html本次安装PC下载:jdk-18_windows-x64_bin.msi,可以根据自......
  • ubuntu 16.04 ORB-SLAM3安装
    目录1.安装依赖库1.1安装Pangolin1.2安装Opencv1.3安装Eigen31.4其他依赖2安装ORB-SLAM31.安装依赖库1.1安装Pangolin注意:在github:https://github.co......
  • Codeforces Round #606(B-D)
     Dashboard-CodeforcesRound#606(Div.2,basedonTechnocup2020EliminationRound4)-CodeforcesB.MakeThemOdd题意:一个数组,每次选择一个数,将数组中的......