Building ROS 2 Crystal Clemmys on Ubuntu 18.04 for NVIDIA® Jetson™ Modules

Building ROS 2 Crystal Clemmys on Ubuntu 18.04 for NVIDIA® Jetson™ Modules

Jetson AGX Xavier | Jetson Nano | Jetson TX2 NX | Jetson Xavier NX

25 June 2021

Building ROS 2 Crystal Clemmys for NVIDIA® Jetson™ Modules


In this blog post, we will talk about how to build ROS 2. ROS 2 has multiple versions of ROS 2 but only Crystal Clemmys is supported by Ubuntu 18.04.

All the steps were taken from the official tutorial: https://docs.ros.org/en/crystal/Installation/Linux-Development-Setup.html


Installing ROS 2 Prerequisites


First, you should build ROS 2 on Ubuntu. You have to set locale that supports UTF-8.


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


You should authorize the GPG key and add the ROS 2 apt repositories to the system.


sudo apt update
sudo apt install curl gnupg2 lsb-release
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -

Building ROS 2 from the source


Then you should install all development and ROS tools for ROS 2 installation.


sudo apt install -y build-essential
sudo apt install -y cmake
sudo apt install -y git
sudo apt install -y python3-colcon-common-extensions
sudo apt install -y python3-lark-parser
sudo apt install -y python3-pip
sudo apt install -y python-rosdep
sudo apt install -y python3-vcstool
sudo apt install -y wget

python3 -m pip install -U argcomplete
python3 -m pip install -U flake8
python3 -m pip install -U flake8-blind-except
python3 -m pip install -U flake8-builtins
python3 -m pip install -U flake8-class-newline
python3 -m pip install -U flake8-comprehensions
python3 -m pip install -U flake8-deprecated
python3 -m pip install -U flake8-docstrings
python3 -m pip install -U flake8-import-order
python3 -m pip install -U flake8-quotes
python3 -m pip install -U pytest-repeat
python3 -m pip install -U pytest-rerunfailures
python3 -m pip install -U pytest
python3 -m pip install -U pytest-cov
python3 -m pip install -U pytest-runner
python3 -m pip install -U setuptools

sudo apt install --no-install-recommends -y libasio-dev
sudo apt install --no-install-recommends -y libtinyxml2-dev

Creating a Workspace & Setting up an Environment


Now we should create a workspace and clone all repositories to this workspace.


mkdir -p ~/ros2_crystal/src
cd ~/ros2_crystal
wget https://raw.githubusercontent.com/ros2/ros2/crystal/ros2.repos
vcs import src < ros2.repos


Then install dependencies using rosdep.


sudo rosdep init
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro crystal -y --skip-keys "console_bridge fastcdr fastrtps libopensplice67 libopensplice69 rti-connext-dds-5.3.1 urdfdom_headers"


Finally, you should set up your environment with the source below.


. ~/ros2_crystal/install/setup.bash

Testing ROS 2 on  Jetson™ Modules


Let's test with some examples. Open two different terminals. In one of them, source the setup file and run the C++ talker. You should see the terminal like the picture below.



In the other terminal, source the setup file and run the Python listener. You should see the terminal like the picture below.


Thank you for reading our blog post. 



Türkçe