- vscode安装ros插件
- mkdir -p ros_tes_wst/src
- 用vscode打开工作空间
- 右键src–>catkin_create–>打依赖
- 配置
- setting.json
{
"configurations": [
{
"browse": {
"databaseFilename": "",
"limitSymbolsToIncludedHeaders": true
},
"includePath": [
"/opt/ros/kinetic/include/**",
"/usr/include/**"
],
"name": "ROS"
}
],
"version": 4
}
- launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) 启动",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/devel/lib/ros_test/listener_node",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"preLaunchTask": "catkin_make: build",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
}
]
}
- task.json
{
"version": "2.0.0",
"tasks": [
{
"type": "catkin_make",
"command":"catkin_make",
"args": [
"-DCMAKE_BUILD_TYPE=Dubug"
],
"problemMatcher": [
"$catkin-gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"label": "catkin_make: build"
}
]
}
10.CMakeList.txt中加入SET(CMAKE_BUILD_TYPE Debug)