A VS Code extension for quickly running ROS2 launch files, Python nodes, and C++ nodes.
Note: This document is available in Chinese (中文版请查阅 README_zh.md)
Right-click any .launch.py file and select "ros2 launch" to:
- Automatically find the ROS2 workspace
- Source the workspace's
install/setup.bash - Execute
ros2 launch <package_name> <launch_file>
Right-click any .py or .cpp file and select "ros2 run" to:
- Automatically find the ROS2 workspace and package name
- Source the workspace's
install/setup.bash - Execute
ros2 run <package_name> <node_name>
Right-click any file and select "ros2 source" to:
- Display the workspace name
- Source the workspace in a new terminal
Right-click any folder in your ROS2 workspace and select "colcon build" to:
- Automatically find the ROS2 workspace root
- Open a terminal at the workspace root
- Execute
colcon build
Smart path detection:
- Right-click
xxx_ws/→ build inxxx_ws/ - Right-click
xxx_ws/src/→ build inxxx_ws/ - Right-click any sub-folder (e.g.
xxx_ws/src/pkg_a) → build inxxx_ws/
The extension automatically:
- Finds the ROS2 workspace by searching for directories whose
src/subdirectory contains at least one package withpackage.xml - Extracts the package name by parsing the
package.xmlfile in the package directory - Executes commands in a new VS Code terminal
The extension expects a standard ROS2 workspace structure:
~/ros2_ws/
├── src/ # Source packages
├── install/ # Built packages (after colcon build)
├── build/ # Build files
└── log/ # Log files
Therefore, you need to run colcon build first before using this extension. If you only have source packages without building, the extension will not be able to find the correct package name.
- Search for
ros2-quick-runnerin VS Code extensions and install it - Open your ROS2 project in VS Code
- Right-click on a file in the explorer:
.launch.pyfiles → "ros2 launch".pyor.cppfiles → "ros2 run"- Any file → "ros2 source"
- Any folder → "colcon build"
| Command | Description |
|---|---|
ros2-quick-runner.ros2launch |
Launch a .launch.py file |
ros2-quick-runner.ros2run |
Run a Python or C++ node |
ros2-quick-runner.getWorkspaceName |
Get and source the workspace |
ros2-quick-runner.colconBuild |
Build the ROS2 workspace |
- VS Code 1.80.0 or higher
- ROS2 installed (e.g., ROS 2 Humble)
- A compiled ROS2 workspace with
install/directory
For detailed changelog, please see: CHANGELOG.md
For Chinese documentation, please see: README_zh.md