Getting Started with ROS and ROS2 on Jetson AGX Orin™

The new Jetson AGX Orin™ from NVIDIA® is the ideal device for autonomous robotics. Learn how to get started with ROS and ROS2 on the Jetson AGX Orin™.

The performance of the new Jetson AGX Orin™ unlocks capabilities such as processing 3D data coming from multiple ZED 2i Depth Cameras, making it the ideal combination for autonomous robotics and edge analytics solutions. It is now available for purchase on the Stereolabs store.

Nvidia Jetson AGX Orin

Reading this article you will learn how to make the Jetson AGX Orin ready to control a robot and make it perceive the world in 3D by installing ROS Noetic Ninjemys and ROS2 Foxy Fitzroy. You will also learn how to use the latest Nvidia Jetpack SDK 5.0.1 DP which introduces Jetson Linux v34.1.1, the first Linux for Tegra operating system based on Ubuntu 20.04.

But first things first, why should you use the new Jetson AGX Orin over the AGX Xavier?

AGX Orin vs AGX Xavier : up to 2.5x faster

According to tests performed by our research team, the new Jetson AGX Orin outperforms the AGX Xavier, the former most powerful Jetson on the market, by a maximum factor of 2.5x.

The following graph compares the performances of the two embedded devices for Depth Extraction (left bars), Object Detection (center bars), and Skeleton Tracking (right bars). Performance increases by a factor of 1.5x at worst, with an average factor of ~ 1.8x.

AGX Orin allows you to take advantage of the new Neural depth mode for real-time applications like robotics and autonomous navigation with no compromises.

Install the ZED SDK on Jetson AGX Orin

Before installing ROS or ROS2 you must first install the latest ZED SDK for Nvidia Jetpack 5 if you have not already done it. You can download the installer from the developer section of the Stereolabs website.

You can read our guide to make the Jetson AGX Orin ready for the first boot.

Open a terminal console and enter the following commands

cd Downloads
chmod +x ZED_SDK_Tegra_L4T<os_ver>_v<sdk_ver>.run
./ZED_SDK_Tegra_L4T<os_ver>_v<sdk_ver>.run

Replace <os_ver> and <sdk_ver> with the correct values of the name of the file that you downloaded. When the process is completed you can install ROS or ROS2.

How to Install ROS Noetic on Jetson AGX Orin

ROS Noetic Ninjemys is the latest and last LTS release of the first version of ROS. After May 2025 no more supported ROS releases will be officially available.

ROS Noetic

Install ROS Noetic

Set up your computer to accept software from packages.ros.org.

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

Set up the keys

sudo apt install curl # if you haven't already installed curl
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -

Make sure your Debian package index is up-to-date

sudo apt update

Install the packages useful for a robotic platform

sudo apt install ros-noetic-desktop

Automatically source the environment setup script every time a new shell is launched. These commands will do that for you.

Bash shell

echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc

zsh shell

echo "source /opt/ros/noetic/setup.zsh" >> ~/.zshrc
source ~/.zshrc

Install the dependencies to build packages

sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential python3-rosdep

Initialize rosdep

sudo rosdep init
rosdep update

Install the ZED ROS Wrapper

The ZED ROS Wrapper is a ready package that allows integrating the ZED SDK capabilities into the ROS world. The ZED ROS Wrapper is open source and the code is available on Github.

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
git clone --recursive 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

Note: using the flag --recursive with the git clone command is really important to install the zed-ros-interfaces repository as a sub-module and so adding all the custom messages required by the ZED ROS Wrapper.

Automatically source the development environment setup script every time a new shell is launched:

Bash shell

cd ~/catkin_ws
echo "source $(pwd)/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc

zsh shell

cd ~/catkin_ws
echo "source $(pwd)/devel/setup.bash" >> ~/.zshrc
source ~/.zshrc

Install the examples and tutorial

If you want to test how ROS works on the Jetson AGX Orin, we provide a full set of examples and tutorials

$ cd ~/catkin_ws/src
$ git clone https://github.com/stereolabs/zed-ros-examples.git
$ cd ../
$ rosdep install --from-paths src --ignore-src -r -y
$ catkin_make -DCMAKE_BUILD_TYPE=Release
$ source ./devel/setup.bash

You can find the documentation of the ZED ROS Wrapper and the tutorials online on the Stereolabs documentation website.

How to Install ROS2 Foxy on Jetson AGX Orin

ROS2 is the new generation of the Robotic Operating System framework. ROS2 Foxy Fitzroy is not the latest LTS distribution, ROS2 Humble Hawksbill has been recently released, but it requires Ubuntu 22.04 for the binary installation and the latest Jetson Linux is based on Ubuntu 20.04. When Nvidia releases CUDA, CUDNN, and TensorRT for Ubuntu 22.04, we will also release the ZED SDK for the latest OS version, and provide a guide to create a Docker container to run ROS2 Humble on Jetson AGX Orin.

ROS2 Foxy
ROS2 Foxy

Install ROS2 Foxy

Make sure you have a locale that supports UTF-8

locale  # check for UTF-8

sudo apt update && sudo apt install locales
sudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8

locale  # verify settings

You need to add the ROS2 apt repositories to your system

sudo apt update && sudo apt install curl gnupg2 lsb-release
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key  -o /usr/share/keyrings/ros-archive-keyring.gpg

Add the repository to your sources list

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null

Update your apt repository caches after setting up the repositories

sudo apt update

ROS2 packages are built on frequently updated Ubuntu systems. It is always recommended that you ensure your system is up to date before installing new packages

sudo apt upgrade

Install the packages useful for a robotic platform

sudo apt install ros-foxy-ros-base

Automatically source the environment setup script every time a new shell is launched. These commands will do that for you.

Bash shell

echo "source /opt/ros/foxy/setup.bash" >> ~/.bashrc
source ~/.bashrc

zsh shell

echo "source /opt/ros/foxy/setup.zsh" >> ~/.zshrc
source ~/.zshrc

Install the dependencies to build packages

sudo apt update && sudo apt install -y build-essential cmake git libbullet-dev python3-colcon-common-extensions python3-flake8 python3-pip python3-pytest-cov python3-rosdep python3-setuptools python3-vcstool wget

Initialize rosdep

sudo rosdep init
rosdep update

Install the ZED ROS2 Wrapper

The ZED ROS2 Wrapper is a ready package that allows integrating the ZED SDK capabilities into the ROS2 world. The ZED ROS Wrapper is open source and the code is available on Github.

mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src/
git clone  --recursive https://github.com/stereolabs/zed-ros2-wrapper.git
cd ..
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install --cmake-args=-DCMAKE_BUILD_TYPE=Release

Automatically source the development environment setup script every time a new shell is launched:

Bash shell

cd ~/ros2_ws/
echo source $(pwd)/install/local_setup.bash >> ~/.bashrc
source ~/.bashrc

zsh shell

cd ~/ros2_ws/
echo "source $(pwd)/install/local_setup.zsh" >> ~/.zshrc
source ~/.zshrc

Install the examples and tutorial

If you want to test how ROS2 works on the Jetson AGX Orin, we provide a full set of examples and tutorials

cd ~/ros2_ws/src/
git clone https://github.com/stereolabs/zed-ros2-examples.git
cd ../
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install --cmake-args=-DCMAKE_BUILD_TYPE=Release
source ~/.bashrc

Note: using the flag --recursive with the git clone command is really important to install the zed-ros2-interfaces repository as a sub-module and so adding all the custom messages required by the ZED ROS2 Wrapper.

You can find the documentation of the ZED ROS2 Wrapper and the tutorials online on the Stereolabs documentation website.

Known issues with ROS2 Foxy

Image Transport and topic subscriptions

There is an issue with the function CameraPublisher::getNumSubscribers preventing the correct counting of the number of nodes subscribing one of the topics published by an image_transport::CameraPublisher object.

We suggest installing version v3.0.0, published on 2021-05-26, that contains the fix for this issue. Please note that earlier or later versions do not work as expected.

To install the latest version from sources:

cd ~/ros2_ws/src # Access the source folder of your colcon workspace
git clone https://github.com/ros-perception/image_common.git -b ros2 # clone the "ros" branch of the "image_common" repository
cd <colcon_workspace> # Go back to the root of your colcon workspace
colcon build --symlink-install # Compile everything and install

Close the console and re-open it to apply the modifications.

Image Transport Plugins and compressed topics

The image_transport_plugins package is not correctly working with ROS2 Foxy (see hereherehere, and here). We suggest you remove it to avoid many annoying warning messages until the ROS2 developers fix it or use this workaround:

sudo apt remove ros-foxy-image-transport-plugins ros-foxy-compressed-depth-image-transport ros-foxy-compressed-image-transport

Conclusion

Your Xavier AGX Orin is now ready to control a robotic platform with ROS and ROS2! Thanks to the Stereolabs ZED cameras, it will be able to perceive the environment in 3D as we humans do.

If you need help with setting up ROS and ROS2 on your Jetson AGX Orin or using your ZED stereo camera, don’t hesitate to contact us on the support portal or the community forum.

NVIDIA® Jetson AGX Orin™ Developer Kit is now available and shipping from the Stereolabs store

Tags