This package lets you use the ZED stereo camera with ROS. It outputs the camera left and right images, depth map, point cloud, pose information and supports the use of multiple ZED cameras.
- First, download the latest version of the ZED SDK on stereolabs.com
- Install the ZED ROS wrapper
- For more information, check out our ROS documentation. If you want to customize the wrapper, check the ZED API documentation
- Ubuntu 16.04 or newer (Ubuntu 18 recommended)
- ZED SDK ≥ 3.0 and its dependency CUDA
- ROS Kinetic or ROS Melodic
Note: an older version of the wrapper compatible with the SDK v2.8.x is available here
The zed_ros_wrapper is a catkin package. It depends on the following ROS packages:
- nav_msgs
- tf2_geometry_msgs
- message_runtime
- catkin
- roscpp
- stereo_msgs
- rosconsole
- robot_state_publisher
- urdf
- sensor_msgs
- image_transport
- roslint
- diagnostic_updater
- dynamic_reconfigure
- tf2_ros
- message_generation
- nodelet
Open a terminal, clone the repository, update the dependencies and build the packages:
$ cd ~/catkin_ws/src
$ git clone https://github.com/stereolabs/zed-ros-wrapper.git
$ cd ../
$ rosdep install --from-paths src --ignore-src -r -y
$ catkin_make -DCMAKE_BUILD_TYPE=Release
$ source ./devel/setup.bash
To launch the ZED node use
ZED camera:
$ roslaunch zed_wrapper zed.launch
ZED Mini camera:
$ roslaunch zed_wrapper zedm.launch
ZED2 camera:
$ roslaunch zed_wrapper zed2.launch
To select the ZED from its serial number:
$ roslaunch zed_wrapper zed.launch serial_number:=1010 #replace 1010 with the actual SN
Example launch files to start a pre-configured Rviz environment to visualize the data of ZED, ZED Mini and ZED 2 cameras are provided in the zed-ros-examples
repository
SVO recording can be started and stopped while the ZED node is running using the service start_svo_recording
and the service stop_svo_recording
.
More information
The SDK v3.0 introduces the Object Detection and Tracking module. The Object Detection module is available only with a ZED 2 camera.
The Object Detection can be enabled automatically when the node start setting the parameter object_detection/od_enabled
to true
in the file zed2.yaml
.
The Object Detection can be enabled/disabled manually calling the services start_object_detection
and stop_object_detection
.
The Spatial Mapping can be enabled automatically when the node start setting the parameter mapping/mapping_enabled
to true
in the file common.yaml
.
The Spatial Mapping can be enabled/disabled manually calling the services start_3d_mapping
and stop_3d_mapping
.
The ZED node publishes diagnostic information that can be used by the robotic system using a diagnostic_aggregator node.
With the rqt
plugin Runtime monitor
, it is possible to retrieve all the diagnostic information, checking that the node
is working as expected.
For robots moving on a planar surface it is possible to activate the "2D mode" (parameter tracking/two_d_mode
in common.yaml
).
The value of the coordinate Z for odometry and pose will have a fixed value (parameter tracking/fixed_z_value
in common.yaml
).
Roll and pitch and relative velocities will be fixed to zero.
Examples and tutorials are provided to better understand how to use the ZED wrapper and how to integrate it in the ROS framework.
See the zed-ros-examples
repository
Alongside the wrapper itself and the Rviz display, a few examples are provided to interface the ZED with other ROS packages :
- RTAB-Map: See zed_rtabmap_example
- ROS Nodelet,
depthimage_to_laserscan
: See zed_nodelet_example - AR Track Alvar: See zed_ar_track_alvar_example
A few tutorials are provided to understand how to use the ZED node in the ROS environment :