ROS 2 - ZED Mono Node
The easiest way to start a ZED ROS 2 node for a monocular camera is by using the command line:
where <camera model> must be replaced with one of zedxonegs, zedxone4k, or zedxonecore. Use zedxonegs for a ZED X One GS or a ZED X One S.
Published Topics
The ZED node publishes data to the following topics:
-
Status
~/status/heartbeat: heartbeat signal to monitor if the node is alive from other nodes (custom message).~/status/svo: status of the SVO playback (only advertised when an SVO file is used as input).
-
Image streams
The image topic names are created using the following naming convention:
~/<sensor_type>/<color_model>/<rect_type>/imageStarting from version 5.1.0 of the ROS 2 Wrapper the new convention replaces the previous formats such as
~/<sensor_type>/image_<rect_type>_<color_model>and~/<sensor_type>_<rect_type>/image_<rect_type>_<color_model>(e.g.,~/left/image_rect_color,~/rgb_raw/image_raw_gray). Please update your launch files and scripts to use the new topic names.- RGB channel
~/rgb/color/rect/image: Color rectified image.~/rgb/color/rect/camera_info: Color camera calibration data.~/rgb/gray/rect/image: Grayscale rectified image.~/rgb/gray/rect/camera_info: Grayscale camera calibration data.~/rgb/color/raw/image: Color unrectified image.~/rgb/color/raw/camera_info: Color raw calibration data.~/rgb/gray/raw/image: Grayscale unrectified image.~/rgb/gray/raw/camera_info: Grayscale raw calibration data.
- RGB channel
Since v5.5.0 of the ROS 2 Wrapper the distortion_model and the distortion coefficients published in the camera_info topics are read from the ZED SDK (>= 5.4) instead of a hard-coded per-model table that the lens does not always follow: a fisheye ZED X One now reports equidistant instead of rational_polynomial. Rectified parameters are reported as plumb_bob with zero coefficients.
-
Sensors data
~/imu/data~/imu/data_raw~/temperature~/left_cam_imu_transform
Image Transport
The ROS 2 wrapper supports the stack image_transport introduced with ROS 2 Crystal Clemmys.
Starting from version 5.3 of the ROS 2 Wrapper, image messages are published through rclcpp::TypeAdapter for more efficient handling:
- The base
rawtopic is handled by aTypeAdapterpublisher. Intra-process subscribers (e.g., other nodes running in the same component container) receive aStampedSlMatobject (a wrapper around the nativesl::Mat) directly, without any serialization overhead. Inter-process subscribers transparently receive a standardsensor_msgs/msg/Imagemessage thanks to the automaticTypeAdapterconversion. - The transport-specific variants are handled by an
image_transportpublisher. Itsrawtransport is disabled to avoid publishing duplicate messages, since therawstream is already provided by theTypeAdapterpublisher described above.
To prevent silent data corruption caused by incompatible plugin/encoding combinations, the advertised image transports are filtered by topic type. Visual image topics (color and grayscale images) advertise only:
compressed: JPEG or PNG compressed imagetheora: Ogg Theora compressed imagezstd: lossless Zstandard-compressed image (available starting with ROS 2 Jazzy Jalisco)
For proper association between images and their corresponding camera information, the ZED ROS 2 Wrapper also publishes camera_info topics for all compressed image streams:
~/rgb/color/rect/image/camera_info~/rgb/gray/rect/image/camera_info~/rgb/color/raw/image/camera_info~/rgb/gray/raw/image/camera_info
When the isaac_ros_nitros package is installed and NITROS is not disabled via the debug.disable_nitros parameter, NITROS publishers take priority and neither the TypeAdapter nor the image_transport publishers are created. Please refer to the dedicated section about NVIDIA® Isaac ROS Nitros for more details.
NVIDIA® Isaac ROS Nitros
The ZED ROS 2 Wrapper supports NITROS with NVIDIA® Isaac™ ROS 3.2. Isaac™ ROS 5 removed the NITROS packages: with Isaac™ ROS 5, the ZED node publishes standard ROS 2 messages and IPC is enabled automatically. See the ZED Isaac™ ROS Integration Overview.
The ZED ROS 2 Wrapper supports the NVIDIA® Isaac™ ROS Nitros package for zero-copy transport of ROS messages using NVIDIA® GPUDirect® RDMA.
NVIDIA® Isaac ROS Nitros integration is enabled and used only if the required packages are manually installed. They are not added as a dependency because this is an optional feature.
Starting from version 5.3 of the ROS 2 Wrapper, Intra-Process Communication (IPC) is handled automatically: it is disabled when NITROS is enabled and enabled when NITROS is disabled. You can use the debug.disable_nitros parameter to disable NITROS and force IPC to be enabled if needed. See the ZED Stereo Node page for how the enable_ipc launch argument interacts with NITROS.
For more information about the installation and usage of the NVIDIA® Isaac™ ROS packages, please refer to the dedicated section of the documentation: ZED Isaac™ ROS Integration Overview.
CUDA zero-copy transport
Starting with v5.6.0, on ROS 2 Lyrical and newer, the ZED ROS 2 Wrapper supports the rosidl::Buffer message fields and shares the images retrieved on the GPU without copies. In ROS 2 Lyrical, the uint8[] data field of the sensor_msgs/msg/Image message is a rosidl::Buffer, whose memory can live on the GPU: the cuda buffer backend shares this GPU memory between a publisher and its subscribers.
The general.buffer_backend parameter selects how the images are published:
cuda(default): the images stay in GPU memory. The subscribers that accept thecudabackend and run on the same host, with the same GPU and the same Linux user, receive the GPU memory of the ZED node without copies. All the other subscribers, such as RViz2,ros2 bag, Python nodes, and nodes on other hosts, automatically receive standard CPU data, with no change on their side.cpu: the node always publishes standard CPU data, as in the previous versions.
An invalid value is replaced by cuda, with a warning. On ROS 2 Humble and Jazzy, the parameter is ignored.
The CUDA zero-copy transport requires the cuda_buffer package when the wrapper is built, the cuda_buffer_backend plugin when the node runs, and the rmw_fastrtps_cpp middleware (Fast DDS), the default of ROS 2 Lyrical, or the rmw_zenoh_cpp middleware (Zenoh) v0.10.5 or newer. When a requirement is missing, the node publishes standard CPU data. At startup, the node logs the transport in use in the line that starts with * Buffer transport:, and the reason when it falls back to CPU data.
With the cuda backend, the node still publishes standard CPU data, for all the subscribers of a topic, in these cases:
- An rclcpp Intra-Process Communication (IPC) subscriber is connected to the topic: IPC delivers the messages without the buffer backend negotiation. To receive CUDA buffers in a node loaded in the ZED container, disable IPC for that node.
- The topic uses the
TRANSIENT_LOCALdurability, not supported by thecudabackend.
The compressed image_transport topics always carry CPU data, and do not change how the uncompressed image topics are published. The topics published with NITROS are not affected.
The CUDA zero-copy transport guide of the Isaac™ ROS 5 integration explains how the transport works and how to set it up. To receive the CUDA buffers in your own C++ nodes, follow the image tutorial.
QoS profiles
All the topics are configured by default to use the following ROS 2 QoS profile:
- Reliability: RELIABLE
- History (Depth): KEEP_LAST (10)
- Durability: VOLATILE
- Lifespan: Infinite
- Deadline: Infinite
- Liveliness: AUTOMATIC
- Liveliness lease duration: Infinite
Read the official ROS 2 documentation about the QoS and the related settings for details.
The QoS settings can be modified by changing the relative parameters in the YAML files, as described in this official ROS 2 design document.
When creating a subscriber, be sure to use a compatible QoS profile according to the following tables:
Compatibility of QoS durability profiles:
Compatibility of QoS reliability profiles:
In order for a connection to be made, all of the policies that affect compatibility must be compatible. For instance, if a publisher-subscriber pair has compatible reliability QoS profiles, but incompatible durability QoS profiles, the connection will not be made.
For a detailed list of all the compatibility settings, please refer to the official ROS 2 documentation.
Configuration parameters
Specify your launch parameters in the common_mono.yaml, zedxonegs.yaml, zedxone4k.yaml, and zedxonecore.yaml files available in the folder zed_wrapper/config.
General parameters
Namespace: general
common_mono.yaml
timestamp_reference: 'IMAGE_CENTER_OF_EXPOSURE' requires an input that carries a per-frame exposure, that is a ZED X One GS or a ZED X One 4K, live, from an SVO or from a stream. On any other camera the node warns once and falls back to IMAGE. It is not applied to the sensors data, to the SVO /clock topic, nor in simulation.
Since v5.6.0 of the ROS 2 Wrapper, when the camera is disconnected while the node is running, the node waits general.camera_timeout_sec x general.camera_max_reconnect seconds (25 by default) for it to come back. If it does, the node resumes publishing; otherwise, the node closes the camera and stops as described in When the node stops. Previous versions either waited forever while the ZED SDK was reopening the camera, or were killed as soon as the ZED SDK reported the camera as not detected.
While the camera is disconnected, the node diagnostic reports Camera disconnected: waiting for it to come back (N / 25 sec), and the Disconnections entry counts the disconnections of the session with the time of the last reconnection.
zedxonegs.yaml, zedxone4k.yaml, and zedxonecore.yaml
Valid grab_resolution values per camera model:
A grab_frame_rate of 120 FPS requires the SVGA resolution, so it is not available with the ZED X One 4K. On the ZED X One 4K, HD4K and QHDPLUS run at 15 FPS, and HD1200 and HD1080 at up to 60 FPS.
When the node stops
Since v5.6.0 of the ROS 2 Wrapper, a node that fails for good (the camera cannot be opened at start-up or does not come back after a disconnection or a reboot, invalid configuration, critical camera error) closes the camera and stops cleanly. The general.exit_on_failure parameter decides what happens next:
true: the whole process stops.zed_camera.launch.pysets this value when it creates the container, so the launch then ends andros2 launchreturns. The process exits with code 0, so a supervisor must restart it on any exit (e.g. systemdRestart=always, notRestart=on-failure).false(default): only this node stops, and the other nodes of the same container keep running, for example the other cameras started withzed_multi_camera.launch.py.zed_camera.launch.pysets this value when the node is loaded in an existing container (container_namelaunch argument). The node diagnostic reportsNode stoppedwith the reason; unload the node withros2 component unloadbefore loading it again.
Previous versions stopped the whole container when a node could not open its camera, usually with a crash, which also stopped the cameras of the other nodes in it.
Simulation input parameters
Namespace: simulation
common_mono.yaml
Simulation support for the ZED X One monocular cameras is available starting from v5.5.0 of the ROS 2 Wrapper. Launch the node with sim_mode:=true plus the optional sim_address, sim_port and use_sim_time arguments to publish images and IMU data from the simulated camera. With use_sim_time:=true the node waits for a valid /clock and stamps every topic with the simulation time.
Since v5.6.0 of the ROS 2 Wrapper [ZED SDK >= 5.6 on the simulator and on the node side], the video parameters (video.*, including their dynamic changes) are sent to the simulated camera, and the simulator applies the ones it supports. A setting the simulator does not support is reported once at the INFO level and not applied. With older ZED SDK versions the video parameters are ignored in simulation. See Using the ZED with ROS 2 in Isaac™ Sim to set up the simulated camera.
Streaming input parameters
Namespace: stream
common_mono.yaml
SVO input parameters
Namespace: svo
common_mono.yaml
SVO encryption requires OpenSSL (libcrypto) at runtime. The value of svo.encryption_key is never written to the log, and the same value must be set as svo.decryption_key to play the recording back: if the key is lost the recorded data is unrecoverable.
Streaming server parameters
Namespace: stream_server
common_mono.yaml
Video parameters
Namespace: video
common_mono.yaml
* Dynamic parameter
The node accepts exposure_time and the auto_exposure_time_range_* values from 28 to 30,000 µs, but the camera applies only the exposure range of the model and video mode:
- ZED X One GS and ZED X One S: from 39 µs (21 µs in
SVGA) to one frame period, up to 65,000 µs at 15 fps. - ZED X One 4K: from 16 µs to one frame period, up to 39,000 µs at 15 fps. In HDR mode, from 1,024 µs to one frame period, up to 66,666 µs at 15 fps.
Exposures longer than 30 ms, possible at 15 fps, cannot be set from the node. With ZED SDK 5.6, a value outside the camera range is not applied, and the node logs no warning.
zedxone4k.yaml
Sensors parameters
Namespace: sensors
common_mono.yaml
Since v5.6.0 of the ROS 2 Wrapper, the IMU sampling rate and ranges actually used by the camera are logged at start-up. With a ZED X driver older than 1.5.0, or with another camera model, the IMU keeps its default configuration and the ZED SDK logs a warning.
* Dynamic parameter
Starting from v5.5.0 of the ROS 2 Wrapper the sensors stream is read independently of grab(), so the IMU publishing delay no longer depends on general.grab_frame_rate. The node polls the sensors well above the hardware ODR, so no sample is lost.
sensors.sensors_pub_rate is now decimated against the measured sample interval instead of the rate the ZED SDK advertises, so it is honored on cameras whose IMU does not run at the advertised rate: with ZED SDK 5.5 or earlier, a ZED X One GS advertises 400 Hz but delivers 200 Hz, and sensors_pub_rate: 100 used to produce a steady 50 Hz.
Two consequences of the reduced CPU usage of the sensors thread: a new subscriber to a sensors topic can wait up to 250 ms for its first message, and a subscriber whose QoS is incompatible with the publisher no longer triggers publishing (it could never receive the data anyway).
Advanced parameters
Namespace: advanced
These are advanced threading parameters. Do not modify them unless you are confident of what you are doing. The SCHED_FIFO and SCHED_RR scheduling policies require root privileges, the CAP_SYS_NICE capability, or an RTPRIO limit (ulimit -r) at least equal to the requested priority.
With GMSL2 cameras, ZED SDK >= 5.6 and ZED X driver >= 1.5.0 run the capture and sensors threads of the camera at SCHED_RR priority 5. The ZED SDK installer grants this priority to the members of the zed group, from their next login. A node started by a systemd service that does not run as root needs LimitRTPRIO=5 in the [Service] section, and a Docker container needs --ulimit rtprio=5 (or --cap-add=SYS_NICE). Otherwise, these threads run at normal priority and the ZED SDK logs how to allow it. Giving the node threads a higher real-time priority than 5 can delay the camera capture. Reference: sched(7).
common_mono.yaml
Debug parameters
Namespace: debug
common_mono.yaml
Up to v5.4 the sdk_use_monotonic_clock parameter was declared in the debug namespace of common_mono.yaml, while the node reads it from the general namespace, so it was silently ignored. It is now declared in the right namespace, and it is superseded by general.sdk_timestamp_clock.
Dynamic parameters
The ZED node lets you reconfigure many parameters dynamically during the execution of the node. All the dynamic parameters are indicated with a * in the list above and with the tag [DYNAMIC] in the comments of the YAML files.
You can set the parameters using the CLI command ros2 param set, e.g.:
If the parameter is set successfully, you will get a confirmation message:
In the case you tried to set a parameter that’s not dynamically reconfigurable, or you specified an invalid value, you will get this type of error:
A video setting accepted by the node parameter can still be refused by the camera, when the camera model or the input (SVO, stream, simulation) does not support it, or when the camera rejects the value. Since v5.6.0 of the ROS 2 Wrapper [ZED SDK >= 5.6], the node logs a single warning naming the setting and the reason, and does not retry it until the video parameters change again. Older ZED SDK versions reported such settings as applied. To stop the node from setting video.exposure_compensation or video.ae_antibanding on a camera that refuses it, set the parameter to -1: the camera keeps its own value.
You can also use the Configuration -> Dynamic Reconfigure plugin of the rqt tool to dynamically set parameters by using a graphic interface.
Transform frames
The ZED ROS 2 wrapper broadcasts multiple coordinate frames that each provides information about the camera’s position and orientation. If needed, the reference frames can be changed in the launch file.
<camera_name>_camera_linkis the camera mounting point. It corresponds to the threaded fixing hole at the bottom of the camera.<camera_name>_camera_centeris the center of the camera body.<camera_name>_camera_frameis the position and orientation of the camera CMOS sensor.<camera_name>_camera_frame_opticalis the position and orientation of the camera optical frame.<camera_name>_imu_linkis the origin of the inertial data frame.
Services
The ZED node provides the following services:
~/enable_streaming(std_srvs/srv/SetBool): enable/disable a local streaming server.~/start_svo_rec(zed_msgs/srv/StartSvoRec): Start recording an SVO file. If no filename is provided the defaultzed_one.svo2is used. A filename without a path is saved in the working directory of the node process.~/stop_svo_rec(std_srvs/srv/Trigger): Stop an active SVO recording.~/pause_svo_rec(std_srvs/srv/SetBool): Pause (data: true) and resume (data: false) an active SVO recording without closing the file. It returnssuccess: falsewhen no recording is active, and the diagnostic reportsSVO Recording: PAUSEDwhile paused.~/toggle_svo_pause(std_srvs/srv/Trigger): set/reset SVO playing pause. Only available ifsvo.svo_realtimeis false and if an SVO has been chosen as input source.~/set_svo_frame(zed_msgs/srv/SetSvoFrame): Set the SVO playback frame to the specified value. Only available if an SVO has been chosen as input source.~/reboot_camera(std_srvs/srv/Trigger): Reboots the camera without restarting the node: the node closes the camera, reboots it, reopens it and resumes publishing. The call returns when the camera is back, after about 10 seconds, or fails if the camera does not come back withingeneral.camera_timeout_secxgeneral.camera_max_reconnectseconds, and the node then stops as after a disconnection (see When the node stops). Available for the GMSL cameras with a live input.
Since v5.6.0 of the ROS 2 Wrapper, ~/reboot_camera reboots the camera from a running node. While it runs no data is published and the other services of the node wait. An active SVO recording is stopped, and the streaming server is started again. The diagnostic reports Camera rebooting while it runs, then the Reboots entry gives the number of reboots with the time and result of the last one. Rebooting a GMSL camera restarts the GMSL capture of the device: the other GMSL cameras can stop for a few seconds, and their nodes wait for them as for a disconnection.
Services can be called using the rqt graphical tool by enabling the plugin Plugins -> Services -> Service caller.
It is possible to call a service also by using the CLI command ros2 service call.
For example, to start the local streaming server:
and the service server will reply:
Assigning a GPU to a camera
To improve performance, you can specify the gpu_id of the graphic card that will be used for the image processing in the common_mono.yaml configuration file. The default value (-1) will select the GPU with the highest number of CUDA cores. When using multiple cameras, you can assign each camera to a GPU to increase performance.
Node Diagnostic
The ZED ROS 2 node publishes useful diagnostic information aggregated into the /diagnostics topic using the diagnostic_updater package.
Diagnostic information can be analyzed and parsed by using ROS 2 tools, like for example the Runtime Monitor plugin of rqt.
Available information:
- Uptime
- Camera disconnections: count and time of the last reconnection (since v5.6.0 of the ROS 2 Wrapper)
- Grab frequency and processing time
- Frame drop rate
- Input mode
- Image publishing rate and processing time
- IMU TF broadcasting rate
- IMU data publishing rate
- Camera internal temperature
- Scene Illuminance
- SVO playback status
- SVO recording status, including the
PAUSEDstate - Streaming server status

