No version for distro humble. Known supported distros are highlighted in the buttons above.
No version for distro jazzy. Known supported distros are highlighted in the buttons above.
No version for distro rolling. Known supported distros are highlighted in the buttons above.
Repository Summary
Description | ROS2 OpenCV camera driver that supports intra-process communication |
Checkout URI | https://github.com/clydemcqueen/opencv_cam.git |
VCS Type | git |
VCS Version | master |
Last Updated | 2023-11-03 |
Dev Status | UNKNOWN |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | ipc ros2 opencv3 |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Packages
Name | Version |
---|---|
opencv_cam | 0.2.0 |
README
opencv_cam
A simple ROS2 camera driver based on OpenCV.
Supports ROS2 intra-process comms.
Requires ROS2 and
ros-$ROS_DISTRO-camera-calibration-parsers
.
Builds for ROS2 Foxy, Galactic, Humble and Iron.
Install and build
mkdir ~/ros2/opencv_cam_ws/src
cd ~/ros2/opencv_cam_ws/src
git clone https://github.com/clydemcqueen/opencv_cam.git
git clone https://github.com/ptrmu/ros2_shared.git
cd ~/ros2/opencv_cam_ws/
source /opt/ros/$ROS_DISTRO/setup.bash
colcon build
Usage
Default is to publish images from /dev/video0
:
ros2 run opencv_cam opencv_cam_main
A more complex example:
ros2 run opencv_cam opencv_cam_main --ros-args --remap /image_raw:=/my_camera/image_raw --params-file opencv_cam_params.yaml
… where opencv_cam_params.yaml is:
/opencv_cam:
ros__parameters:
file: True
filename: 'my_camera.MOV'
camera_info_path: 'my_camera_info.ini'
camera_frame_id: 'my_camera'
Intra-process comms
IPC test – CLI composition:
# First shell
ros2 run rclcpp_components component_container
# Second shell (ignore the deprecation warning, see https://github.com/ros2/ros2cli/issues/336)
ros2 component load /ComponentManager opencv_cam opencv_cam::ImageSubscriberNode -e use_intra_process_comms:=true
ros2 component load /ComponentManager opencv_cam opencv_cam::OpencvCamNode -e use_intra_process_comms:=true
Launch file composition:
ros2 launch opencv_cam composition_launch.py
Manual composition – handy for debugging:
ros2 run opencv_cam ipc_test_main
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
file | bool | False | Read from file vs. read from device |
fps | int | 0 | Framerate. Specify 0 to publish at the recorded (file) or default (device) framerate |
filename | string | ”” | Filename, ignored if file is False |
index | int | 0 | Device index, 0 for /dev/video0. Ignored if file is True |
width | int | 0 | Device width in pixels. Specify 0 for default. Ignored if file is True |
height | int | 0 | Device width in pixels. Specify 0 for default. Ignored if file is True |
camera_info_path | string | “info.ini” | Camera info path |
camera_frame | string | “camera_frame” | Camera frame id |
Camera info file formats
Uses the ROS standard camera calibration formats.
Files must end in .ini
or .yaml
.
CONTRIBUTING
No CONTRIBUTING.md found.
No version for distro noetic. Known supported distros are highlighted in the buttons above.
No version for distro ardent. Known supported distros are highlighted in the buttons above.
No version for distro bouncy. Known supported distros are highlighted in the buttons above.
No version for distro crystal. Known supported distros are highlighted in the buttons above.
No version for distro eloquent. Known supported distros are highlighted in the buttons above.
No version for distro dashing. Known supported distros are highlighted in the buttons above.
No version for distro galactic. Known supported distros are highlighted in the buttons above.
No version for distro foxy. Known supported distros are highlighted in the buttons above.
No version for distro iron. Known supported distros are highlighted in the buttons above.
No version for distro lunar. Known supported distros are highlighted in the buttons above.
No version for distro jade. Known supported distros are highlighted in the buttons above.
No version for distro indigo. Known supported distros are highlighted in the buttons above.
No version for distro hydro. Known supported distros are highlighted in the buttons above.
No version for distro kinetic. Known supported distros are highlighted in the buttons above.
No version for distro melodic. Known supported distros are highlighted in the buttons above.