Giter VIP home page Giter VIP logo

vscode-ros's Introduction

ROS VSCode Extension (Deprecated)

Note: A newer version of this extension has been published as ms-iot.vscode-ros. Please uninstall this extension and install the new one.

This Visual Studio Code (VSCode) extension provides support for Robot Operating System (ROS) development.

Getting Started

The extension will automatically start when you open a catkin workspace. The build system (e.g. catkin_make or catkin build) will automatically be confirmed from the hidden files associated with each system. The ROS distro will automatically be confirmed from the parent environment, or you will be prompted to select a ROS distro if this can't be done automatically.

You must build the catkin workspace at least once before the extension will recognise it.

To start ROS master, use the "ROS: Start Core" command. The "ROS master" indicator in the bottom left will show if the master is currently running, and you can click on this to view parameters etc. If you hit F5 you can create a debug configuration to run a rosrun or roslaunch command.

The first time you open the workspace the extension will automatically create build and test tasks and update the C++ and Python paths. You can re-run this process later using the appropriate commands.

Features

  • Automatic ROS environment configuration.
  • Allows starting, stopping and viewing the ROS master status.
  • Automatically discover catkin_make or catkin build build tasks.
  • Create catkin packages using catkin_create_pkg script or catkin create pkg.
  • Run rosrun or roslaunch (breakpoints currently not supported).
  • Syntax highlighting for .msg, .urdf and other ROS files.
  • Automatically add the ROS C++ include and Python import paths.
  • Format C++ using the ROS clang-format style.

Commands

Name Command Description
Create Catkin Package ros.createCatkinPackage Create a catkin package. You can right click on a folder in the explorer to create it in a specific location.
Create Terminal ros.createTerminal Create a terminal with ROS sourced.
Show Master Status ros.showMasterStatus Open a detail view showing details about the ROS master.
Start Core ros.startCore Spawn a ROS core
Stop Core ros.stopCore Kill the ROS core
Update C++ Properties ros.updateCppProperties Update the C++ include path to include ROS.
Update Python Path ros.updatePythonPath Update the Python path to include ROS.

vscode-ros's People

Contributors

ajshort avatar jamesgiller avatar kejxu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-ros's Issues

roslaunch debug

Do you think it's possible to implement breakpoint with roslaunch and rosrun ?

Green squiggly line

Though I installed the ROS extension for VSCode. The green squiggly lines don't disappear. The ROS master has a check mark and I ran catkin_make from the vs-code terminal. How to access the ros headers from vscode and get rid of green squiggly lines?

Use vscode-ros with singularity container

Dear developers,

I was wondering if I can set up this plugin to work with a ROS kinetic version that is installed on a singularity container. The reason I am asking is that I am currently working on ubuntu 18.04 but kinetic is only supported on Ubuntu 18.04.

Problem
Now when I try to change the include path to point to the .../singularity/containers/my_container/opt/ros/kinetic/include folder inside the singularity image it resets to the /opt/ros/kinetic/include/ when I close the C/C++ configuration menu. Following I then get the cannot find /opt/ros/kinetic/include error since on the main Ubuntu system ROS melodic is installed.

Warning about "vscode.previewHtml' command which is deprecated"

I'm getting the following warning from VSCode:

Extension 'ajshort.ros' uses the 'vscode.previewHtml' command which is deprecated and will be removed soon. Please file an issue against this extension to update to use VS Code's webview API.

It does not seem to cause problems now.. but it may in the future.
I'm just following what the warning says.

Env:

  • VS Code 1.32.3
  • ROS extension 0.3.0

Use vscode-ros from the host machine to access files in VM

I have sshfsed my home directory of an Ubuntu VM (where I installed ROS and created a workspace) in a directory of my host machine, so that I could access and edit the files from my host machine (which is a Mac OS X) using the editors and IDEs of my host machine.

I installed this extension for my version of VS Code on my host machine to do that. However, after having opened the mounted folder of my catkin workspace in VS Code and reloaded the editor, I get the following warning/error on the bottom-right of the editor

The ROS distro is not configured.

I am not sure if this extension was designed to support this work environment. Is there way to configure this extension for it to know that the ROS distro is installed in the VM?

Short tutorial for vscode-ros missing

I just tested using vscode with ros and I think that it would be good to have a simple tutorial on how to set up the vscode for a given catkin workspace properly.

The following steps allowed me to run CMake and build the catkin workspace both from the terminal using catkin_make and from vscode by running CMake: Configure and CMake: Build:

  1. In a terminal, source the ros distribution by running the command: source /opt/ros/indigo/setup.bash. Then in this same terminal open vscode by running the command code.
  2. Create catkin workspace
  3. Compile the catkin workspace at least once
  4. In vscode: go to File -> Open Folder and open the src folder of the catkin workspace
    Note: vscode will create a build folder inside the src folder of the catkin workspace. This build folder can be deleted once vscode is configured properly.
  5. In vscode:
    4.a Either: in .vscode/settings.json set the cmake.buildDirectory to ${workspaceRoot}/../build
    4.b Or: in Workspace Settings set the CMake: Build Directory to ${workspaceRoot}/../build
  6. Now vscode is configured properly. The vscode commands CMake: Configure and CMake: Build allow to rerun CMake and Build the catking workspace.

catkin tools support

Hi,

Thanks for this neat extension. Are there any plans to support catkin tools? Or may be you could point me to what changes would be needed and I could try to add support and send a PR?

Cheers,
Raghav

Roslaunch configuration doesn't work

I'm using VS Code Insider and trying to use configuration:

{
  "configurations": [
    {
      "command": "roslaunch",
      "debugSettings": "${command:debugSettings}",
      "name": "launcher_name.launch",
      "package": "pkg_name",
      "type": "ros",
      "target": "launcher_name.launch",
      "request": "launch"
    }
  ],
  "version": "0.1.0"
}

and when I hit f5 it says:

Usage: roslaunch [options] [package] [arg_name:=value...]
roslaunch [options] [...] [arg_name:=value...]
If is a single dash ('-'), launch XML is read from standard input.
roslaunch: error: The following input files do not exist: undefined

Ability to disable autoformatting

Hi :)

I really like your project, it makes developing in VSCode for ROS so much nicer.
Unfortunately our team uses a different formatting style, which means, that I always need to disable this plugin, because it messes with the c/c++ formatting build into VSCode.

Would you be open to adding a option, which would allow to disable formatting?

(This is also loosely related to #18 )

Could not source the setup file for ROS distro "melodic"

I configured my distro to melodic through the pop-up msg, and now I get a notification that says Could not source the setup file for ROS distro "melodic". Furthermore my #include "ros/ros.h" and #include "std_msgs/String.h" statements are showing errors.

See the image below:

image

ros melodic: catkin: command not found

When I run catkin_make from terminal everything works fine, but when I use the catkin release or debug tasks I get bash: catkin: command not found

ros gets sourced in my .bashrc.

An suggestions?

Support for ROS2

Can it be extended to support ROS2.0 somehow or are there any plans to do it?

Adopt Multi Root Workspace APIs

Since the latest stable release included support for multi root workspaces, I guess it is important for this extension to follow the guidelines for adapting to the new API.

In particular, I have found references to the now deprecated workspace.rootPath:
master branch

src/catkin.ts
27:  const cwd = typeof uri !== "undefined" ? uri.fsPath : vscode.workspace.rootPath;

src/build.ts
18:  pfs.exists(vscode.workspace.rootPath + "/.vscode/c_cpp_properties.json").then(exists => {
30:  const filename = vscode.workspace.rootPath + "/.vscode/c_cpp_properties.json";

src/extension.ts
39:  baseDir = await utils.findCatkinWorkspace(vscode.workspace.rootPath);

4-catkin-tools-support branch

src/extension.ts
44:  baseDir = vscode.workspace.rootPath;

src/build.ts
18:  pfs.exists(vscode.workspace.rootPath + "/.vscode/c_cpp_properties.json").then(exists => {
30:  const filename = vscode.workspace.rootPath + "/.vscode/c_cpp_properties.json";

Also, for the commands like creating a package/running a build, we should probably ask the user which workspace folder they want to add the package to/run the build in.

Any other ideas, in accordance to the changes as listed in the linked wiki?
I will read further into it.

Commands not found and no syntax highlighting

I am running the following version of VS Code on Ubuntu 16.04
1.15.1

I installed the extension from "Extensions" in the Activity Bar, and was prompted to also install the dependency Msg Language Support. To try it out, I created a new workspace according to catkin_tools quickstart (I should say that the catkin init command does not create a link to the top-level CMakeLists.txt file like catkin_init_workspace does).

Everything seemed to install fine, but when I started to try the extension by running Start Core command in my opened workspace an error appeared saying "command 'ros.startCore' not found". Similar errors appear for all other commands, so it seems like none of the commands were actually installed.

Opening a CMakeLists.txt file also shows no syntax highlighting.

Light theme not visible

Using the "Light" or "Light+" color theme, the headers of tables in ROS Master Status is dark grey background with black text, which is not very readable. Could those colors be changed?

Holistic vscode setup for ROS

Thanks a lot for the effort with the plugin! I just installed it, but wonder how I can transform my VSCode into a full-blown IDE for ROS C++ and Python development. Specifically I'm looking for:

  • correct and useful code completion (python and c++)
  • catkin build/partial build tasks
  • c++ code analysis (unused vars, function, includes, ..)
  • c++ and python linter
  • llvm/gdb debugging
  • git integration that can deal with the catkin workspace setup (each package in src/ is a git repo, managed by wstool
  • .. whatever clion can do :)

I've been playing a lot with the common cmake and c++ plugings, but failed to configure everything to be really useful. Some issues I encounter:

  • Intellisense can't find includes or wrong ones (my own common_types.h was assotiated with pcl's common_types.h
  • code completion shows me any symbol there is, but not the members of an object I'm comleting on
  • code completion and resolving dependencies takes quite some time and is apparently not caching, so every time I close and open a c++ file, I have to wait a minute or so until I can start working.

PS: I know there is RoboWare, but this attempt fails at so many core code develop features, but concentrates on rather fancy high-level stuff like GUI and rosmaster inspection.

Certain commands fail due to missing dylib in MacOS with SIP enabled

Hi,
In MacOS, certain commands like ros.updateCppProperties fails due to missing dylibs. The error message shown in vscode when running the command is

Command failed: rospack list
dyld: Library not loaded: librospack.dylib
  Referenced from: /opt/ros/melodic/bin/rospack
  Reason: image not found

ROS package creation via catkin_tools is failing

Hello:

It seems that package creation via 'catkin create pkg' command is failing through the extension. I checked catkin.ts file and think that it needs changing at line #35
it is currently -
createPkgCommand = catkin create pkg --catkin-deps ${dependencies} -- ${name};
it should be -
createPkgCommand = catkin create pkg ${name} --catkin-deps ${dependencies};

thank you, Sam.

VSCode is no longer supporting specifiying a commandId in the "initialConfigurations" contribution

Hi,

We noticed your extension in package.json is using a "initialConfigurations" contribution in a deprecated way by specifiying a command id.
We wanted to let you know that we plan to delete support for this specific use of "initialConfigurations" soon.
More about this deprecation can be found here and in our release notes.
A good example on how to use the DebugConfigurarationProvider which is the new way of doing this can be found here

Also note other deprecations which are specified in our release notes (which can be found on our site).

Kind regards,
Isidor from the VSCode team

Unable to import Custom Python service module

Sorry, if this is obvious to seasoned users. I am just trying out VSCode with my ROS development.

I have defined a .msg and .srv in my package. I have built the workspace, which works fine in the created terminal. But running a python debugging session stops at the import of the custom service module. I have tried the "ROS: Update Python Path" command, but that does not seem to include the built module. If I create a terminal with "ROS: Create Terminal" and "> source devel/setup.bash" in that terminal, the node runs fine.

ROS Master status doesn't refresh

In order to refresh ROS Master status, it seems necessary to close and open the tab. Would it be possible to auto-refresh the page, or have a refresh button?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.