Linux VSCode 项目开发环境配置


task.json

{
	"version": "2.0.0",
	"tasks": [
		{
			"type": "shell",
			"command": "cd ${workspaceFolder};mkdir build;cd build;cmake -DCMAKE_BUILD_TYPE=debug ..;make",
			"args": [
			],
			"problemMatcher": [
				"$catkin-gcc"
			],
			"group": {
				"kind": "test",
				"isDefault": true
			},
			"label": "catkin_make: build"
		}
	]
}

launch.json

{
    // 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": [
        {
            "preLaunchTask": "catkin_make: build",
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/build/planner",
            "args": [
                "-i",
                "../maps/random.yaml",
                "-o",
                "../build/output.yaml"
            ],
            "stopAtEntry": false,
            "cwd": "${fileDirname}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        }
    ]
}