First Time ZED2 Camera Setup - Carleton-SRL/SPOT GitHub Wiki

First Time ZED Camera Setup

This guide will be covering the first time setup for the ZED camera. This guide assumes you are setting up the camera for the first time on a completely fresh NVIDIA Jetson device running JetPack 5.1.4-b17 and Ubuntu 20.04 LTS .

Compatibility

It is important to make sure you are using the right versions for this guide. You can check the JetPack version by running the command sudo apt-cache show nvidia-jetpack in the Jetson Orin terminal. You should see something like:

Package: nvidia-jetpack
Version: 5.1.4-b17
Architecture: arm64
Maintainer: NVIDIA Corporation
Installed-Size: 194
Depends: nvidia-jetpack-runtime (= 5.1.4-b17), nvidia-jetpack-dev (= 5.1.4-b17)
Homepage: http://developer.nvidia.com/jetson
Priority: standard
Section: metapackages
Filename: pool/main/n/nvidia-jetpack/nvidia-jetpack_5.1.4-b17_arm64.deb
Size: 29298
SHA256: 5439dabb8d7a097c215602f7cd11773e4745c5e7d5841d9a0a2551a58b82883e
SHA1: b0c2faa6a9d14e056e394625a11a1a8ed8780327
MD5sum: 05fc4b73de35fd33a535fb887c1947ee
Description: NVIDIA Jetpack Meta Package
Description-md5: ad1462289bdbc54909ae109d1d32c0a8
  • To check your Ubuntu version, run the command lsb_release -a and you should see something like this:
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.6 LTS
Release:	20.04
Codename:	focal

ZED Camera SDK Installation

  • First, connect the camera to the Orin. Open a terminal, either directly on the Orin with a monitor plugged in or using SSH. If you are using SSH, you can open Windows Subsystem for Linux (WSL) on the Ground Station computer, then type:
ssh [email protected]
  • Note that if you may need to change the name and/or IP address depending on which Jetson you want to use. Once connected, we can check to make sure that the ZED camera is properly connected by typing lsusb in the terminal. It should return:
spot-vision@ubuntu:~$ lsusb
Bus 002 Device 003: ID 2b03:f582 STEREOLABS ZED camera
Bus 002 Device 002: ID 2109:0822 VIA Labs, Inc. USB3.1 Hub             
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 2109:2822 VIA Labs, Inc. USB2.0 Hub             
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  • In this case we are looking for a device with the name STEREOLABS ZED camera , which we can indeed see in the list above. Before moving on we need to confirm a few things. First, let’s check that CUDA is properly installed on the Jetson computer. To do so, run the command nvcc --version ; if CUDA is installed you will see something like this:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Sun_Oct_23_22:16:07_PDT_2022
Cuda compilation tools, release 11.4, V11.4.315
Build cuda_11.4.r11.4/compiler.31964100_0
  • Note the version of CUDA that you have installed, as you will need to know it when you download the SDK for the ZED camera. If you do not see CUDA version, you may need to do the following. First, check that CUDA is present on the Jetson at all by running:
ls -l /usr/local/cuda/bin/nvcc
  • Which should return:
spot-vision@ubuntu:~$ ls -l /usr/local/cuda/bin/nvcc
-rwxr-xr-x 1 root root 16370032 Aug 14  2024 /usr/local/cuda/bin/nvcc
  • If nothing was returned, CUDA is likely not installed. But if it was returned, then try this command:
spot-vision@ubuntu:~$ /usr/local/cuda/bin/nvcc --version
  • If this worked, then CUDA is installed but the path is incorrectly set. Fix this by running the following commands in the terminal:
export PATH=/usr/local/cuda/bin:$PATH
source ~/.bashrc
  • Run the nvcc --version command again to confirm the path is now working. If you see the CUDA version, then you can proceed with the rest of the ZED camera setup. Go to the ZED downloads page and download the version of the ZED SDK that corresponds to the JetPack version being used and the CUDA version.
  • If you downloaded the file onto a computer other then the Jetson, you will need to move it over to the Jetson. You can do this using any SFTP software (such as FileZilla). In the terminal, navigate to the directory in which you placed the ZED SDK installer. In this case, we navigate to the Downloads folder, then run ls to confirm the file is present:
spot-vision@ubuntu:~$ cd Downloads
spot-vision@ubuntu:~/Downloads$ ls
ZED_SDK_Tegra_L4T36.4_v4.2.5.zstd.run
  • You will need to ensure that zstd is installed on the Jetson by running sudo apt install zstd . Once complete, you need to add execution permission to the installer using the command below (ensure the file name used matches the version downloaded):
chmod +x ZED_SDK_Tegra_L4T36.4_v4.2.5.zstd.run
  • Next, run the installed using:
./ZED_SDK_Tegra_L4T36.4_v4.2.5.zstd.run
  • Proceed through the installation steps:
    • Accept the EULA agreement;
    • Install the static version of the ZED SDK;
    • Install the AI Module;
    • Do not install samples unless you need to, as it can take a long time depending on your internet connection;
    • Install the dependencies;
    • Install the Python API;
      • When asked which Python executable to use, if you keep the default of python3 this will install the ZED SDK to the global Python executable. There are more steps below to install it into a virtual environment.
    • Do NOT run the ZED Diagnostics unless you have a lot of time to spare;
  • Once everything is installed, reboot the Jetson to ensure everything is set correctly. You can then proceed to recording footage with the camera.