From c3869388390ce7121312c7e3e3d7fcc82b7ea7f1 Mon Sep 17 00:00:00 2001 From: Azarakhsh Keipour Date: Sat, 28 Dec 2019 14:44:15 -0500 Subject: [PATCH] VSCode: Autogenerating launch.json entry for the tilted_hex gazebo simulation - Couldn't make the recent changes in tasks from master branch work, so: - Added gzclient to the command for gazebo tiltedhex and gazebo kill tasks - Also used the desired presentation for the gazebo tiltedhex task --- .vscode/tasks.json | 78 +++++++++++------------- platforms/posix/Debug/launch_sim.json.in | 49 +++++++++++++++ 2 files changed, 86 insertions(+), 41 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index ab7f5c98f1..656a3973fa 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -129,6 +129,42 @@ } ] }, + { + "label": "gazebo hexa_x_tilt", + "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/hexa_x_tilt.world & gzclient", + "isBackground": true, + "presentation": { + "reveal": "always", + "panel": "dedicated" + }, + "problemMatcher": [ + { + "pattern": [ + { + "regexp": ".", + "file": 1, + "location": 2, + "message": 3 + } + ], + "background": { + "activeOnStart": true, + "beginsPattern": ".", + "endsPattern": ".", + } + } + ] + }, { "label": "gazebo plane", "type": "shell", @@ -289,50 +325,10 @@ } ] }, - { - "label": "gazebo hexa_x_tilt", - "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/hexa_x_tilt.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 kill", "type": "shell", - "command": "killall gzserver", + "command": "killall gzserver; killall gzclient", "presentation": { "echo": false, "reveal": "never", diff --git a/platforms/posix/Debug/launch_sim.json.in b/platforms/posix/Debug/launch_sim.json.in index 762be4e3f7..9ecc27c424 100644 --- a/platforms/posix/Debug/launch_sim.json.in +++ b/platforms/posix/Debug/launch_sim.json.in @@ -50,6 +50,55 @@ ] } }, + { + "name": "SITL (gazebo tilthex)", + "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": "hexa_x_tilt" + } + ], + "externalConsole": false, + "preLaunchTask": "gazebo hexa_x_tilt", + "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 (gazebo plane)", "type": "cppdbg",