The ROS wrapper is an interface between the ZED SDK and the ROS framework.
Note: This is for ZED SDK 1.2 only. Please see the latest SDK guide for ROS here.
The ROS wrapper is an interface between the ZED SDK and the ROS framework. This wrapper lets you access ZED stereo images, depth map, 3D point cloud and 6-DoF motion tracking in the ROS environment.
The wrapper is a catkin package that publish ZED measurements such as depth and odometry on ROS topics. You will need to match the following ROS dependencies:
You also need to install the ZED SDK with CUDA and OpenCV, as described on our Getting Started page.
The latest ROS wrapper can be found on our GitHub page. Download and extract the content of the .zip file. Once extracted, rename and copy the folder zed-ros-wrapper in the catkin workspace source directory ~/catkin_ws/src. If you haven’t created your workspace yet, follow this short tutorial on ROS wiki.
Now you just need to compile the wrapper from your catkin workspace source directory ~/catkin_ws/src.
To do so, open a terminal and execute the following commands:
cd ~/catkin_ws catkin_make source ./devel/setup.bash
To run the program, you need to use a launch file which contains different parameters such as camera resolution or depth map mode.
Open a terminal and execute the following command:
roslaunch zed_wrapper zed.launch
The wrapper is now running and the ZED camera outputs are now accessible on the published ROS topics.
A topic is a bus over which data is exchanged or published. For example, you can access ZED left image data on the /zed/left/image_rect_color topic.
Here is the full list of published topics:
You can easily display ZED images and depth using rviz or rqt_image_view. Just select a topic in the rqt GUI to display it in the main window.
To display the point cloud, launch the rviz visualizer with the following command:
rosrun rviz rviz
Now move your mouse to the top left of the rviz window and select zed_initial_frame in Displays->Global Options->Fixed Frame.
Click on add (bottom left), choose the ‘By Topic’ tab, and select point_cloud->cloud->PointCloud2.
To visualize the odometry in rviz, click on the Add button (bottom left), and select the ZED odom topic under the By topic tab. To display odometry data correctly, make sure to select the newly created Odometry object in the left list, set Position tolerance and Angle Tolerance to 0, and Keep to 1.
It is possible to use multiple ZED cameras with ROS. Simply launch zed_multi_cam using the roslaunch command:
roslaunch zed_wrapper zed_multi_cam.launch
Note: The ZED camera uses the full USB 3.0 bandwidth to output video. When using multiple ZED, you may need to reduce camera framerate and resolution to avoid corrupted frames (green or purple frames). You can also use multiple GPUs to load-balance computations and improve performance.
For more information, read the ZED ROS wiki page.