Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>ROS2 ClicksNew to Visual Studio Code? Get it now.
ROS2 Clicks

ROS2 Clicks

LemonLin

|
2 installs
| (0) | Free
Build, launch and run ROS 2 packages from the sidebar with one click, with automatic environment sourcing.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

ROS2 Clicks

Build, launch and control ROS 2 packages from the VS Code sidebar. One click replaces the colcon build --packages-select ... and source install/setup.bash you type dozens of times a day.

Chinese documentation: see README.zh-CN.md, also shipped with the extension.


Why

A normal ROS 2 edit loop is: change a node, open a terminal, type colcon build --packages-select my_pkg, wait, remember that this shell has not sourced the new install, type source install/setup.bash, then finally ros2 run. Four steps, two of them pure ceremony.

This extension puts all of it behind a click:

  • Packages, launch files and your own commands are listed in the sidebar
  • The ROS distribution and the workspace install/setup.bash are sourced automatically
  • Build results, exit codes and timings are recorded per package

Features

Packages view

Every package in the workspace, found by scanning package.xml. Click a package to build it.

  • Status icon per package: not built / building / success / failed
  • Relative build time next to the name (5 minutes ago), refreshed live
  • Right click to build with --packages-up-to — rebuild the package plus everything that depends on it, useful after touching a .msg or .srv
  • Title bar has a --symlink-install toggle and a build-all button

--symlink-install is on by default: for Python packages, editing a .py file takes effect immediately without rebuilding.

Build a package with one click

Launch view

Every *.launch.py, *.launch.xml and *.launch.yaml in the workspace, listed with its package, format and declared launch arguments (parsed from DeclareLaunchArgument).

  • Click to start in its own terminal
  • Two start modes: by source path (default, edits take effect immediately) or by package name (ros2 launch <pkg> <file>, requires a build)
  • Stop sends SIGINT so ros2 launch runs its own shutdown and closes the nodes it started

Launch file actions

Saved commands view

Store the commands you keep retyping — keyboard teleop, ros2 topic list, whatever.

  • One click runs it in a dedicated terminal, with the environment already sourced
  • Add from the view title bar, or select a line in the editor and use "Add selection as saved command"
  • Commands are stored in .vscode/ros2-commands.json, a plain JSON file you can edit, back up or share
  • Terminate button sends Ctrl+C and keeps the terminal

Saved commands and their JSON file

Favorites

Right click any package, launch file or command to pin it to the top of its list. Pinned items show a star and survive restarts.

Getting started

  1. Install the extension.
  2. Open a ROS 2 workspace root — the directory containing install/ and build/.
  3. Reload the window. A robot icon appears in the activity bar.

The extension auto-detects the workspace root and the ROS distribution under /opt/ros. If it guesses wrong, set ros2OneClick.workspacePath and ros2OneClick.rosSetupScript.

Commands

Search ROS2 in the command palette (Ctrl+Shift+P).

Action Shortcut
Rebuild the last package Ctrl+Alt+B
Pick packages to build Ctrl+Alt+Shift+B

Everything else — build all, launch a file, add/edit/run a saved command, toggle symlink install, show the log — is in the command palette.

Settings

Setting Default Description
ros2OneClick.workspacePath auto Workspace root. Leave empty to detect.
ros2OneClick.rosSetupScript auto Path to the ROS setup.bash, e.g. /opt/ros/jazzy/setup.bash. A bare distro name also works.
ros2OneClick.symlinkInstall true Add --symlink-install to colcon build.
ros2OneClick.extraBuildArgs empty Extra arguments appended to colcon build.
ros2OneClick.launchMode file file launches the source file by path, so edits apply immediately. package uses ros2 launch <pkg> <file> and requires a build.
ros2OneClick.autoSourceAfterBuild true Source install/setup.bash in the ROS shell after a successful build.
ros2OneClick.clickToBuild true Single click on a package starts a build.
ros2OneClick.showStatusBar true Show the status bar entry.

How it works

Builds and launches run as VS Code tasks and terminals rather than hidden subprocesses, so you see the real colcon and ros2 output and the extension gets a real exit code.

Two details worth knowing:

  1. source only affects the shell it runs in. VS Code terminals are independent processes. The extension therefore keeps a dedicated ROS2 Shell terminal for builds and sources into it. Launch files and saved commands each get their own terminal, so a long-running Gazebo session does not block your build loop.

  2. Stopping a launch sends SIGINT, not SIGHUP. Closing a terminal sends SIGHUP, and ros2 launch terminates on SIGHUP without running its shutdown sequence — the Gazebo or RViz processes it started become orphans and keep holding the port. Sending SIGINT (what Ctrl+C does) lets the launch system shut every node down. If a process still refuses to exit, the extension escalates to SIGTERM and then SIGKILL.

Requirements

  • ROS 2 (any distribution) with colcon on PATH
  • Linux or macOS. Windows may work through WSL but is untested.

Known limitations

  • Only directories containing a package.xml are discovered. Directories with a COLCON_IGNORE file are skipped, matching colcon behaviour.
  • The UI text is English only. Simplified Chinese is available in README.zh-CN.md.

Development

# ROS2_TEST_WS points at a workspace that has packages and launch files
export ROS2_TEST_WS=~/ros2_ws
node test/run-test.js            # build flags, launch stop, Ctrl+C
node test/run-test-favorites.js  # running indicator, favorites
python3 build_vsix.py            # package a .vsix without npm or vsce

The tests drive the extension against a mock of the VS Code API, so they run headless.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft