Turn Any Camera into ROS2 Image Topics — Unified Pipeline for Any Hardware
When deploying VLA models (like π₀ (pi-zero), OpenVLA) on real robots, or collecting SFT demonstration data for robot learning, you need camera feeds as ROS2 image topics.
But here's the reality:
The Problem:
┌─────────────────────────────────────────────────────────────────────────┐
│ 🔄 "I want to align with an existing dataset collected on different │
│ hardware — how do I replicate the same camera setup?" │
│ │
│ 🎥 "My data was collected with Insta360 GO 3S, RealSense, USB webcams │
│ on different machines — I need a unified way to configure them" │
│ │
│ ⏰ "Writing cam2image launch files for each camera is tedious" │
│ │
│ 🔀 "Camera device IDs keep changing after every reboot!" │
└─────────────────────────────────────────────────────────────────────────┘
AnyCam2Ros provides a unified solution:
The Solution:
┌─────────────────────────────────────────────────────────────────────────┐
│ 🎥 Insta360 GO 3S ─┐ │
│ 📷 USB Webcam ─┼──▶ /dev/video* ──▶ AnyCam2Ros ──▶ ROS2 │
│ 🤖 Any V4L2 Device ─┘ CLI Topics │
│ │
│ ✅ Unified config across different hardware │
│ ✅ Stable device paths (no more reordering after reboot) │
│ ✅ One command to configure everything │
│ ✅ Shareable JSON config for dataset alignment │
└─────────────────────────────────────────────────────────────────────────┘
AnyCam2Ros = Any Camera → ROS2 Image Topics → VLA Training / Robot Deployment
| Scenario | How AnyCam2Ros Helps |
|---|---|
| Dataset Alignment | Replicate camera setups from existing datasets on your hardware |
| VLA Model Deployment | Quickly configure cameras for π₀, OpenVLA, RT-2 deployment |
| SFT Data Collection | Unified pipeline for collecting manipulation demos |
| Multi-Camera Setup | Configure 2-4 cameras in minutes with consistent naming |
| Cross-Machine Sharing | Export/import JSON configs between different robots |
In Linux, everything is a file. If your device can produce video, it becomes /dev/video*.
| Device Type | Example | Works with AnyCam2Ros? |
|---|---|---|
| Action Camera | Insta360 GO 3S, GoPro (as webcam) | ✅ Yes |
| Depth Camera | RealSense (RGB stream) | ✅ Yes |
| USB Webcam | Logitech C920, generic UVC | ✅ Yes |
| Industrial Camera | FLIR, Basler (with V4L2 driver) | ✅ Yes |
| Phone as Webcam | Android USB Webcam mode, DroidCam | ✅ Yes |
| Capture Card | Elgato, HDMI grabbers | ✅ Yes |
| Virtual Camera | OBS Virtual Cam, v4l2loopback | ✅ Yes |
If it shows up in /dev/video*, we can publish it to ROS2.
| Feature | Description |
|---|---|
| 🔍 Auto-Discovery | Scans all /dev/video* devices and shows hardware info |
| 🛡️ Stable Paths | Uses /dev/v4l/by-id so camera order survives reboots |
| 🎨 Beautiful CLI | Rich interactive TUI with tables, spinners, and colors |
| ⚡ Zero Boilerplate | Generates optimized cam2image scripts instantly |
| 📦 Shareable Config | JSON config for team collaboration and dataset alignment |
# Clone the repository
git clone https://github.com/ly-geming/AnyCam2Ros.git
cd AnyCam2Ros
# Install dependencies
pip install rich# Install v4l-utils for camera detection
sudo apt install v4l-utils
# Install ROS2 image_tools
sudo apt install ros-${ROS_DISTRO}-image-toolspython3 scripts/camera_cli.pyThe interactive wizard will:
- Scan — Detect all connected cameras
- Select — Choose which cameras to configure
- Configure — Set resolution, FPS, ROS namespace
- Generate — Create ready-to-run launch scripts
generated_cameras/
├── start_cam_front.sh # Individual camera script
├── start_cam_wrist.sh # Individual camera script
└── start_all_cams.sh # Launch everything with one command
Start all cameras:
./generated_cameras/start_all_cams.shVerify with image_view:
ros2 run image_view image_view --ros-args -r image:=/hdas/camera_front/color/image_rawpython3 scripts/camera_cli.pyShare your cameras.json with teammates or across machines:
python3 scripts/camera_cli.py --from-configpython3 scripts/camera_cli.py \
--config /path/to/cameras.json \
--output-dir /path/to/scripts/| Dependency | Description |
|---|---|
| Linux | Required for V4L2 device handling |
| Python 3.8+ | CLI runtime |
| ROS2 | image_tools package |
| v4l-utils | Camera detection (v4l2-ctl) |
Contributions are welcome! Feel free to submit a Pull Request.
MIT © ly-geming
⭐ Star this repo if it helps your robot project! ⭐