ROS2 Click RViz2

Description
This VS Code extension adds a convenient RViz2 button to your status bar. With a single click, it automatically detects if you're in a ROS2 workspace, sources the setup files if needed, and launches RViz2 in a new terminal.
Features
✅ Adds a dedicated RViz2 button to the bottom-right status bar
✅ Automatically detects ROS2 workspaces
✅ Sources install/setup.bash
when in a ROS2 workspace
✅ Launches RViz2 with zero configuration
✅ Works in any directory (ROS2 workspace or not)
Why use ROS2 Click RViz2?
ROS2 developers frequently need to launch RViz2 to visualize robot data. This extension eliminates the need to:
- Open a separate terminal
- Navigate to your workspace
- Source the setup files
- Launch RViz2 manually
With just one click, you can now focus on what matters most - your robotics application.
Usage
- Look for the telescope icon labeled "RViz2" in the bottom-right status bar.
- Click the button to launch RViz2.
- If in a ROS2 workspace, it automatically sources the workspace first.
- RViz2 launches in a new terminal instance.
Requirements
- ROS2 installed (Foxy, Galactic, Humble, Iron, or Rolling)
- VS Code 1.99.0 or newer
Compatibility
Tested and verified with:
- ROS2 Foxy, Galactic, Humble, Iron, and Rolling
- Ubuntu 20.04, 22.04
- Windows 10/11 with ROS2 installed
Troubleshooting
RViz2 doesn't launch or shows errors:
- Verify that ROS2 is properly installed and that
ros2 run rviz2 rviz2
works in a terminal
- Check that your workspace is built correctly if you're expecting automatic sourcing
Button doesn't appear:
- Try reloading VS Code window
- Check that the extension is installed and enabled
Future Updates
🔹 Configuration options for custom launch parameters
🔹 Support for specific RViz configuration files
🔹 Integration with ROS2 launch files
🔹 Theme-aware button styling
Repository
This extension is open source and available on GitHub
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This extension is licensed under the MIT License.