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] ResourceNotFoundError when running debugger while building with colcon #1300

Open
2 tasks done
Achllle opened this issue Sep 19, 2024 · 0 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@Achllle
Copy link

Achllle commented Sep 19, 2024

  • Linux: Ubuntu 20.04
  • ROS 1: Noetic

version: main (35f2f3b)
I'm running the extension in a devcontainer.

what is the bug

When compiling ROS 1 packages using colcon instead of catkin_make, the launch debug task does not find the nodes being launched as the workspaceOverlayPath is incorrectly set to devel instead of install, causing an error dialog to come up with a 'ResourceNotFoundeError`. The offending logic for that is here.

    if (newEnv.ROS_VERSION === "1") {
        workspaceOverlayPath = path.join(`${vscode.workspace.rootPath}`, "devel_isolated");
        if (!await pfs.exists(workspaceOverlayPath)) {
            workspaceOverlayPath = path.join(`${vscode.workspace.rootPath}`, "devel");
        }
    } else {    // FUTURE: Revisit if ROS_VERSION changes - not clear it will be called 3
        if (!await pfs.exists(workspaceOverlayPath)) {
            workspaceOverlayPath = path.join(`${vscode.workspace.rootPath}`, "install");
        }
    }

Repro steps

  1. compile package with c++ code with colcon
  2. create a launch.json task with request launch which launches a launch file that starts the c++ ROS node
  3. set breakpoints in file
  4. launch that debug job

expected behavior

Debugger launches, finds node, launches it, stops at breakpoint

additional context

I tried debugging this by using the VSIX steps since I'm running inside the container (took a while to figure this out, a link to this in the contributing.md file would have helped)

A simple fix could be to add another nested if statement:

        if (!await pfs.exists(workspaceOverlayPath)) {
            workspaceOverlayPath = path.join(`${vscode.workspace.rootPath}`, "install");

though the better solution would be to not use the ROS_VERSION to inform the location but instead find whatever install or devel files exist.

VScode also tells me that vscode.workspace.rootPath is deprecated and vscode.workspace.workspaceFolder should be used.

Even with these fixes I couldn't get the debugger to actually break at the break points, they simply grey out, so I can't fully test the whole set up, but I'd be happy to create a PR.

@Achllle Achllle added the bug Something isn't working label Sep 19, 2024
@Achllle Achllle changed the title [bug] [bug] ResourceNotFoundError when running debugger while building with colcon Sep 19, 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