#在此配置文件中可以配置头文件路径,
c_cpp_properties.json
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/usr/include/pcl-1.9",
"/usr/include/eigen3",
"/usr/include/vtk-6.2"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "gnu11",
"cppStandard": "gnu++98",
"intelliSenseMode": "linux-gcc-x64"
}
],
"version": 4
}
#这个文件中最主要配置的是"program",用来确定可执行文件的路径,ros工程中需要注释掉"preLaunchTask"。
launch.json
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "g++ - 生成和调试活动文件",
"type": "cppdbg",
"request": "launch",
//"program": "${fileDirname}/${fileBasenameNoExtension}",
"program": "${workspaceFolder}/build/pcl_pcd/read_pcd",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
//"preLaunchTask": "build",
"miDebuggerPath": "/usr/bin/gdb"
}
]
}
#此配置文件中包括了编译指令,作为ros工程,采用catkin进行编译;如果采用cmake进行编译,采用cmake指令;如果单独采用g++编译,则采用g++指令。
tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "catkin_make", //代表提示的描述性信息
"type": "shell", //可以选择shell或者process,如果是shell代码是在shell里面运行一个命令,如果是process代表作为一个进程来运行
"command": "catkin_make",//这个是我们需要运行的命令
"args": [],//如果需要在命令后面加一些后缀,可以写在这里,比如-DCATKIN_WHITELIST_PACKAGES=“pac1;pac2”
"group": {"kind":"build","isDefault":true},
"presentation": {
"reveal": "always"//可选always或者silence,代表是否输出信息
},
"problemMatcher": "$msCompile"
},
]
}