Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] launch.json postDebugTask does not work #1295

Open
3 tasks done
JamesHoi opened this issue Jul 27, 2024 · 0 comments
Open
3 tasks done

[bug] launch.json postDebugTask does not work #1295

JamesHoi opened this issue Jul 27, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@JamesHoi
Copy link

JamesHoi commented Jul 27, 2024

(Please add appropriate labels)

  • Windows: Windows 11 Professional 23H2
  • Linux: WSL 2.0 Ubuntu 20.04
  • ROS 1: Noetic

Version of the plugin
v0.9.2

VS Code Infomation
Version: 1.91.1 (system setup)
Commit: f1e16e1e6214d7c44d078b1f0607b2388f29d729
Date: 2024-07-09T22:06:49.809Z
Electron: 29.4.0
ElectronBuildId: 9728852
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Windows_NT x64 10.0.22635

what is the bug

The option of postDebugTask in launch.json does not work. I have tried another debug configuration using debugpy, postDebugTask works and well done.

launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "ROS: Launch my_project",
            "type": "ros",
            "request": "launch",
            "target": "${workspaceFolder}/src/xxxx/launch/test.launch",
            "preLaunchTask": "catkin_make: build debug",
            "postDebugTask": "rosnode cleanup", // << it does not work
        },
        {
            "name": "test",
            "type": "debugpy",
            "program": "${file}",
            "request": "launch",
            "postDebugTask": "rosnode cleanup" // << it works
        }
    ],
}

task.json

{
	"version": "2.0.0",
	"tasks": [
		{
			"type": "catkin_make",
			"args": [
				"--directory",
				"/home/xxxxx/xxxxx",
				"-DCMAKE_BUILD_TYPE=Debug"
			],
			"problemMatcher": [
				"$catkin-gcc"
			],
			"group": "build",
			"label": "catkin_make: build debug"
		},
		{
			"label": "rosnode cleanup",
			"type": "shell",
			"command": "source /opt/ros/noetic/setup.zsh && yes | rosnode cleanup",
			"presentation": {
				"reveal": "always",
			}
		}
	]
}

Repro steps

  1. Create a simple ros1 workspace and package
  2. add a task in task.json and add postDebugTask option in launch.json file
  3. Using ROS extension to debug launch file
  4. stop debug

expected behavior

when terminate all node it should run postDebugTask, press stop button multi times to kill.
image

additional context

@JamesHoi JamesHoi added the bug Something isn't working label Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant