question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[feature] vscode-ros not sourcing workspace

See original GitHub issue

General information OS version, Ubuntu? Windows: Ubuntu 18.04 Visual studio code version: 1.38.0-insider Version of the plugin: 0.5.0 python environment: miniconda3 (py2.7)

what is the bug

When I try to use the rosrun debug function (F5 after roscore is started) nothing happens. Further when trying to debug the workspace devel/setup.bash is not sourced before debugging the python node. As a result, I can not import modules from other rospackages.

expected behaviour

Having the ability to debug the rosnode on ubuntu 18.04. Further I also expected the Plugin to source the devel/setup.bash file before starting the debugger.

Aditional info

I think this might be caused by the fact that I’m working in a conda environment since also when trying to run a rosnode using the ROS: Run a ROS executable (rosrun) I get the [rospack] Error: package 'panda_autograsp' not found error.

What I already tried I tried setting "python.terminal.activateEnvironment": false in the settings.json. But now although the conda environment is not sourced the ROS application opens a new terminal every time when I try the ROS: Run a ROS executable (rosrun) command. As a result the sourced $PYTHONPATH is removed. This setting did, fortunately, enable me to debug my ROS nodes but not through the vs-code-ros extension.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:17 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
tlobigcommented, Aug 27, 2020

I would also need this feature. even adding the sourcing to .bashrc didn’t work - standard “source /opt/noetic/ …” does, but not sourcing from my install within the catkin workspace. It does work for the terminal window, but when I start code from there, the extension does still not recognize my own packages. So I can’t ros launch for debugging and i can’t use roslaunch from the command palette to start my own nodes.

2reactions
kejxucommented, Sep 3, 2019

Wow thanks that work seamlessly for attaching the process.

Yay! That just sounds wonderful =)

If you could add ROS conda/virtualenv setup.bash file sourcing my ROS Development environment would be complete. I’m unsure if it is a problem with your extension or the general way visual studio behaves, so I also posted an issue on the vscode GitHub gitub.com/microsoft/vscode.

I am not 100% sure what your ROS dev environment looks like, but I agree it would be worthwhile looking into how ROS should work with venv (there’re likely work we need to do for this extension, but we need to dive further into the usage before that). The issue you posted in vscode looks like a very good starting point! Thanks for opening that ticket!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Workspaces in Visual Studio Code
How do I open a VS Code "workspace"? ... The easiest way to open a workspace is using the File menu and selecting...
Read more >
User and Workspace Settings - Visual Studio Code
All features of the Settings editor such as settings groups, search, and filtering behave the same for Workspace settings. Not all User settings...
Read more >
Multi-root Workspaces in Visual Studio Code
VS Code features like global search work across all folders and group the search results by folder. ... When you have a multi-root...
Read more >
Visual Studio Code Workspace Trust security
The Workspace Trust feature lets you decide whether code in your project folder can be executed by VS Code and extensions without your...
Read more >
Troubleshoot Terminal launch failures - Visual Studio Code
If your terminal is set to run as administrator only, and you are not launching VS Code as administrator, the terminal will not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found