Install ROS 2 Foxy Fitzroy

We use ROS 2 for our high-level robot applications, so the ROS 2 middleware + tools need to be installed on the Jetson board. Install ROS on an aarch64 system is straight forward since this architecture is officially supported by ROS 2. However, there is a small problem, as we want to use the latest ROS 2 release (Foxy Fitzroy), the Ubuntu 20.04 LTS must be installed on the Jetson board. Unfortunately, this version of Ubuntu is not officially supported yet by NVIDIA on the Jetson family boards, the latest Ubuntu version available for these boards is 18.04.

To be able to install ROS 2 Foxy, we need to manually upgrade Ubuntu 18.04 to 20.04 on the Jetson Nano board.

Note: Instruction on how to install the Developer kit (ubuntu 18.04 + firmware) on Jetson Nano can be found here https://developer.nvidia.com/embedded/learn/get-started-jetson-nano-devkit

Upgrade ubuntu 18.04 to Ubuntu 20.04 LTS on Jetson Nano

By default, the release upgrade feature is disabled on the provided ubuntu 18.04, to re-enable it, we need to modify the following file:

sudo vi /etc/update-manager/release-upgrades

and change the value of Prompt as follow:

Prompt=lts

The system need to be updated before the release upgrade:

sudo apt update && sudo apt upgrade

After the update, the release upgrade can be performed by the following command:

sudo do-release-upgrade -d -f DistUpgradeViewGtk3

This will open the release upgrade wizard window, follow the instruction on the window to upgraded the system, this can take several hours to finish, so be patient.

I've encountered a problem of upgrading the chromium browser at the end of the process. This problem can be fixed by removing entirely this browser and using Firefox instead:

sudo dpkg --remove chromium-browser
sudo dpkg --remove chromium-browser-l10n

Extra steps after upgrade

Remove remove the old unity desktop, since ubuntu 20.04 replaced it with Gnome 3:

sudo apt purge unity
sudo apt autoremove

Disable the annoying system error report by modify :

sudo vi /etc/default/apport

and set:

enabled=0

Clean up unused packages:

sudo apt-get remove --purge libreoffice*
sudo apt-get remove --purge thunderbird*
sudo apt-get remove --purge transmission*

sudo apt-get clean
sudo apt-get autoremove

It is also important to re-enable NVIDIA repositories which hosts hardware specified packages such as firmwares:

for f in /etc/apt/sources.list.d/*; do
  sudo sed -i 's/^\#\s*//' $f
done

Finally, disable some unused services (such as printer):

sudo systemctl disable containerd.service
sudo systemctl disable cups.service
sudo systemctl disable cups-browsed.service
sudo systemctl disable  avahi-daemon.service
# if you use lightdm
sudo systemctl disable lightdm
# disable snapd
sudo systemctl mask snapd.seeded.service
sudo systemctl mask snapd.socket
sudo systemctl mask snapd
# account daemon
sudo systemctl mask  accounts-daemon.service
# ubuntu error report
sudo systemctl mask whoopsie.service
# file indexing
systemctl  mask tracker-{miner-apps,miner-fs,store}
gsettings set org.freedesktop.Tracker.Miner.Files enable-monitors false

# disable the system to go to sleep, this is usefull in headless mode
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

install ROS 2 Foxy Fitzroy

Now we have the latest Ubuntu 20.04 TLS on the Jetson Nano board, the installation of ROS 2 Foxy Fitzroy is straight forward by following the instruction on: https://index.ros.org/doc/ros2/Installation/Foxy/Linux-Install-Debians/.

Summarize the essential installation steps

First we need to set up sources and add the ROS 2 apt repositories to the system:

Add apt key:

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 -

Add repo to source list:

sudo sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list'

Install the ROS 2 packages:

sudo apt update && sudo apt install ros-foxy-ros-base  python3-colcon-common-extensions

Optionally, install the argcomplete package:

sudo apt install -y python3-pip
pip3 install -U argcomplete

Testing the installed ROS 2

Install the test applications:

sudo apt install ros-foxy-demo-nodes-*

Now test ROS 2 CPP publisher with:

# sourcing the ROS 2 environment:
source /opt/ros/foxy/setup.bash
# run the talker node
ros2 run demo_nodes_cpp talker

then the ROS 2 Python subscriber:

source /opt/ros/foxy/setup.bash
ros2 run demo_nodes_py listener

Automatically sourcing ROS 2 environment in Bash

Add to .bashrc

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

Comments

The comment editor supports Markdown syntax. Your email is necessary to notify you of further updates on the discussion. It will be hidden from the public.
Powered by antd server, (c) 2019 - 2024 Dany LE