编写VSCode的.vscode中的各类文件
vscode下载插件:
Bracket Pair Color DLW
Cmake tools
ROS
讲解参考b站视频
c_cpp_properties.json
{
"configurations": [
{
"browse": {
"databaseFilename": "${workspaceFolder}/.vscode/browse.vc.db",
"limitSymbolsToIncludedHeaders": true
},
"includePath": [
"${workspaceFolder}/**",
"/usr/include/**",
"/usr/local/include/**",
"/opt/ros/melodic/include/**"
],
"name": "ROS",
"intelliSenseMode": "gcc-x64",
"compilerPath": "/usr/bin/gcc",
"cStandard": "gnu11",
"cppStandard": "c++14"
}
],
"version": 4
}
launch.json
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "ROS: Launch",
"request": "launch",
"target": "/home/ros/catkin_ws/src/mobile_car/launch/ndt_mapping.launch",
"launch": [
"rviz",
"gz",
"gzclient",
"gzserver"
],
"type": "ros"
}
]
}
settings.json
ctrl+shift+p
输入:error squiggles
设置错误波形曲线显示与否
“C_Cpp.errorSquiggles”:“Disabled”
这一句就是不显示错误波形曲线
{
"C_Cpp.errorSquiggles":"Disabled",
"files.associations": {
"fstream": "cpp",
"sstream": "cpp",
"iostream": "cpp",
"string": "cpp"
},
"python.autoComplete.extraPaths":[
"/opt/ros/medlodic/lib/python2.7/dist-packages"
],
"python.analysis.extraPaths": [
"/home/ros/catkin_ws/devel/lib/python2.7/dist-packages",
"/opt/ros/melodic/lib/python2.7/dist-packages"
]
}
tasks.json
vscode快捷键编译:ctrl+shift+b
这里设置默认不用询问
不启动vscode自动编译工程的设置
ctrl+逗号 进入设置界面输入:
cmake:config
将Cmake:Configure On Edit勾点掉
将Cmake:Configure On Open勾点掉
{
"version": "2.0.0",
"tasks": [
{
"type": "catkin_make",
"args": [
"--directory",
"/home/xtark/catkin_ws",
"-DCMAKE_BUILD_TYPE=RelWithDebInfo"
],
"problemMatcher": [
"$catkin-gcc"
],
"group": {"kind":"build","isDefault": true},
"label": "catkin_make: build"
}
]
}