This project demonstrates a minimal ROS 2 (Humble) camera pipeline using Python and OpenCV to publish and subscribe to real-time webcam image streams. It can be extended to perform tasks like object detection, face recognition, and computer vision applications in robotics.
- Live camera feed using OpenCV
- Publishes
sensor_msgs/msg/Imageto/image_rawtopic - Subscribes and visualizes camera stream using OpenCV window
- ROS 2 (Humble) compatible
- Lightweight and beginner-friendly
- Ubuntu 22.04
- ROS 2 Humble
- Python 3.10+
cv_bridge,opencv-python,numpy
Install dependencies:
sudo apt install ros-humble-cv-bridge ros-humble-perception
pip install opencv-python numpy==1.24.4
project structure
ros2_cv_ws/
βββ src/
βββ ros2_opencv_pkg/
βββ ros2_opencv_pkg/
β βββ camera_publisher.py
β βββ camera_subscriber.py
βββ package.xml
βββ setup.py
βββ ...