A ROS 2 driver for industrial GigE Vision and USB3 Vision cameras.
ROS 2 GenICam Driver connects GenICam-compatible industrial cameras to ROS 2 through the Aravis library. It discovers devices on the network or bus, exposes camera features as ROS 2 parameters, and publishes images and camera information for downstream perception, inspection, and calibration nodes.
Supported transports are GigE Vision and USB3 Vision. A single node can drive several streams, selected camera features can be re-exposed as dynamically changeable ROS 2 parameters, and a configurable set of device features can be published as diagnostics.
| Executable | Purpose |
|---|---|
camera_finder |
Enumerate reachable devices and print their identifiers. |
camera_driver_gv |
Drive one or more GigE Vision cameras. |
camera_driver_uv |
Drive one or more USB3 Vision cameras. |
camera_xml_exporter |
Write the GenICam feature description of a device to an XML file. |
- ROS 2 on Ubuntu. The CI matrix covers Humble, Iron, Jazzy, Kilted, and Lyrical.
- C++17 compiler and CMake 3.16 or newer.
- Aravis 0.8 or newer, including its development headers.
- The GenICam runtime that ships with your camera vendor, if the camera requires one.
The driver and its message package live in this repository and are built together.
source /opt/ros/jazzy/setup.bash
sudo apt install libaravis-dev
mkdir -p camera_ws/src
cd camera_ws
git clone https://github.com/cpp-hardtech/ros2-genicam-driver.git src/ros2-genicam-driver
rosdep update
rosdep install --from-paths src --ignore-src -y
colcon build --symlink-install --packages-up-to genicam_driver
source install/setup.bashOn a fresh ROS 2 installation, run sudo rosdep init once before rosdep update.
Attach the camera and enumerate the reachable devices:
ros2 run genicam_driver camera_finderThe finder prints a device identifier for each camera. Use that value as guid below. For
GigE Vision cameras the device IP address is also accepted.
ros2 run genicam_driver camera_driver_gv --ros-args -p "guid:=<device-identifier>"For a USB3 Vision camera use camera_driver_uv instead.
In a second terminal, with the workspace sourced:
ros2 topic list
ros2 topic hz /genicam_driver_gv/image_rawThe launch files under genicam_driver/launch/ provide working starting points for both
transports:
camera_driver_gv_example.launch.pycamera_driver_uv_example.launch.pycamera_xml_exporter_example.launch.py
| Topic | Type | Notes |
|---|---|---|
<node>/image_raw |
sensor_msgs/msg/Image |
Per stream. |
<node>/camera_info |
sensor_msgs/msg/CameraInfo |
Per stream, next to the corresponding image topic. |
<node>/<stream>/image_raw |
sensor_msgs/msg/Image |
Used instead when several streams are configured. |
<node>/<stream>/camera_info |
sensor_msgs/msg/CameraInfo |
Same naming rule as above. |
~/diagnostics |
genicam_driver_msgs/msg/CameraDiagnostics |
Only when diagnostic features are configured. |
| Service | Type | Notes |
|---|---|---|
~/calculate_white_balance_once |
genicam_driver_msgs/srv/CalculateWhiteBalance |
Runs a one-shot white balance calculation on the device. |
| Parameter | Type | Default | Purpose |
|---|---|---|---|
guid |
string | — | Device identifier reported by camera_finder, or a GigE Vision IP address. |
stream_names |
string[] | [] |
Stream names used in the topic namespace when several streams are driven. |
camera_info_urls |
string[] | [] |
Calibration URLs, one per stream, passed to camera_info_manager. |
frame_id |
string | "" |
Coordinate frame attached to published images and camera info. |
dynamic_parameters_yaml_url |
string | "" |
YAML file listing device features to expose as dynamic ROS 2 parameters. |
diagnostic_yaml_url |
string | "" |
YAML file listing device features to publish as diagnostics. |
diagnostic_publishing_rate |
double | 0.1 |
Diagnostics publish rate in Hz. |
verbose |
bool | false |
Enables additional logging from the driver. |
timestamp_offset |
double | 0.0 |
Constant offset applied to image timestamps. |
xml_file |
string | "" |
Output path, camera_xml_exporter only. |
genicam_driver/config/dynamic_parameters_example.yaml— which device features become runtime-changeable ROS 2 parameters.genicam_driver/config/camera_diagnostics_example.yaml— which device features are published on~/diagnosticsand under what names.
Feature names and accepted values are defined by the device and can be listed with
camera_xml_exporter, which writes the GenICam XML description of the camera:
ros2 run genicam_driver camera_xml_exporter --ros-args \
-p "guid:=<device-identifier>" -p "xml_file:=$PWD/camera.xml"Set stream_names to one name per stream. The names form the topic namespace, so a node with
stream_names: ["left", "right"] publishes <node>/left/image_raw and
<node>/right/image_raw. Leave the parameter empty to keep the topics directly under the
node name.
See CONTRIBUTING.md.
Distributed under the BSD 3-Clause License. The original copyright notice and the full license text are retained in LICENSE. Provenance and attribution are documented in NOTICE.
