Skip to content

Code snippets compilation related to ZED SDK and ROS with the help of @openai chatgpt

License

Notifications You must be signed in to change notification settings

AnxiousCodeGeek/ZED-ROS-Guide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

ZED-ROS Guide

This repository contains a detailed guide on how to set up and work with the ZED camera using ROS. It includes steps to launch the ZED camera, enable object detection, record data using rosbag, and integrate RTAB-Map for SLAM.

Note:

  • All the commands and guide were followed on Ubuntu 20.04.
  • Directory/file paths may vary.

Prerequisites

Before starting, ensure you have the following tools installed:

  • CUDA environment
  • ROS (Robot Operating System)
  • ZED SDK (version 4.1 or later)
  • ZED ROS Wrapper
  • Python 3.x ( most preferrable python versions are between 3.8 and 3.10)

Setup

Building workplace:

cd ~/catkin_ws
catkin_make 
source devel/setup.bash

ROS-ZED

To activate a command/file in Linux in the launch folder i.e. to set file permissions in the launch folder:

chmod +x [filename]

Launching the ZED Camera

cd ~/catkin_ws/src/zed-ros-wrapper/zed_wrapper/launch
roslaunch zed_wrapper zed2i.launch

Using RViz with ZED

You can visualize the ZED camera feed with RViz by running:

rosrun rviz rviz

To launch ZED camera with RViz

cd ~/catkin_ws/src/zed-ros-examples/zed_display_rviz/launch
roslaunch zed_display_rviz display_zed2i.launch

Object Detection in ZED ROS Wrapper

To enable object detection in the ZED ROS wrapper, modify the common.yaml file:

cd ~/catkin_ws/src/zed-ros-wrapper/zed_wrapper/params/
nano common.yaml
  • Change od_enabled to true:
object_detection:
  od_enabled: true
  • Save and close the file.

Recording Data with rosbag

Record ZED camera data with the following command:

Steps to Record Data:

# rosbag record include-all-rostopics-that-are-used-in-ros-to-view-image-from-zed-camera
rosbag record /zed2i/zed_node/left/image_rect_color /zed2i/zed_node/point_cloud/cloud_registered /zed2i/zed_node/depth/depth_registered /zed2i/zed_node/pose /zed2i/zed_node/path_odom /zed2i/zed_node/path_map /zed2i/zed_node/mapping/fused_cloud /zed2i/zed_node/obj_det/objects /zed2i/zed_node/plane_marker

Steps to Play Back the Recorded Data:

rosbag play your_recorded_data.bag

Integrating RTAB-Map with ROS and ZED Camera

Install RTAB-Map for ROS

sudo apt-get install ros-noetic-rtabmap-ros

Launch RTAB-Map with ZED

cd ~/catkin_ws/src/zed-ros-examples/examples/zed_rtabmap_example/launch
roslaunch zed_rtabmap_example zed_rtabmap.launch
  • In case of the error RLException: [zed_rtabmap.launch] is neither a launch file in package [zed_rtabmap_example] nor is [zed_rtabmap_example] a launch file name:

    • Source your workspace
source ~/catkin_ws/devel/setup.bash

To check ROS related commands

cd ~/catkin_ws
rostopic list

To use any command from rostopic

rostopic echo [topic-name-from-list]

Explanation

rostopic contains the rostopic command-line tool for displaying debug information about ROS Topics, including publishers, subscribers, publishing rate, and ROS Messages. It also contains an experimental Python library for getting information about and interacting with topics dynamically.

To use ZED tools and diagnostics

/usr/local/zed/tools/ZED_Explorer
/usr/local/zed/tools/ZED_Diagnostic

Links

Installation of ZED SDK

Installation of ROS-noetic

Getting Started with ROS and ZED

About

Code snippets compilation related to ZED SDK and ROS with the help of @openai chatgpt

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published