From 71f381ada98331da14767f8083ab8e0afea290ef Mon Sep 17 00:00:00 2001 From: oneWayOut Date: Wed, 2 Sep 2020 00:05:05 +0800 Subject: [PATCH] add gazebo VTOL tiltrotor debug target for VSCode SITL --- .vscode/tasks.json | 40 +++++++++++++++++++ platforms/posix/Debug/launch_sim.json.in | 49 ++++++++++++++++++++++++ 2 files changed, 89 insertions(+) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 0811756034..80a40d31f7 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -249,6 +249,46 @@ } ] }, + { + "label": "gazebo tiltrotor", + "type": "shell", + "dependsOn": "gazebo build", + "options": { + "cwd": "${workspaceRoot}", + "env": { + "GAZEBO_PLUGIN_PATH": "${workspaceRoot}/build/px4_sitl_default/build_gazebo", + "GAZEBO_MODEL_PATH": "${workspaceRoot}/Tools/sitl_gazebo/models", + "PX4_SIM_SPEED_FACTOR": "1" + } + }, + "command": "gzserver --verbose ${workspaceRoot}/Tools/sitl_gazebo/worlds/tiltrotor.world", + "isBackground": true, + "presentation": { + "echo": true, + "reveal": "never", + "focus": false, + "panel": "shared", + "showReuseMessage": false, + "clear": true + }, + "problemMatcher": [ + { + "pattern": [ + { + "regexp": ".", + "file": 1, + "location": 2, + "message": 3 + } + ], + "background": { + "activeOnStart": true, + "beginsPattern": ".", + "endsPattern": ".", + } + } + ] + }, { "label": "gazebo client", "type": "shell", diff --git a/platforms/posix/Debug/launch_sim.json.in b/platforms/posix/Debug/launch_sim.json.in index 762be4e3f7..41b2d1e479 100644 --- a/platforms/posix/Debug/launch_sim.json.in +++ b/platforms/posix/Debug/launch_sim.json.in @@ -197,6 +197,55 @@ ] } }, + { + "name": "SITL (gazebo tiltrotor)", + "type": "cppdbg", + "request": "launch", + "program": "${command:cmake.launchTargetPath}", + "args": [ + "${workspaceFolder}/ROMFS/px4fmu_common", + "-s", + "etc/init.d-posix/rcS", + "-t", + "${workspaceFolder}/test_data" + ], + "stopAtEntry": false, + "cwd": "${command:cmake.buildDirectory}/tmp", + "environment": [ + { + "name": "PX4_SIM_MODEL", + "value": "tiltrotor" + } + ], + "externalConsole": false, + "preLaunchTask": "gazebo tiltrotor", + "postDebugTask": "gazebo kill", + "linux": { + "MIMode": "gdb", + "externalConsole": false, + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + }, + { + "description": "PX4 ignore wq signals", + "text": "handle SIGCONT nostop noprint nopass", + "ignoreFailures": true + } + ] + }, + "osx": { + "MIMode": "lldb", + "externalConsole": true, + "setupCommands": [ + { + "text": "pro hand -p true -s false -n false SIGCONT", + } + ] + } + }, { "name": "SITL (jmavsim iris)", "type": "cppdbg",