Getting the installation Right! Raspberry Pi 4 with Ubuntu 20.04 + ROS Noetic + Intel RealSense

Historical guide: these steps describe my January 2021 setup with Ubuntu 20.04 and ROS Noetic.

Here I am after lot of iterations trying to install Ubuntu on Raspberry Pi 4(RPi4). Initially I made certain mistakes when selecting the correct ubuntu version & Desktop.

The steps below are which I followed to finalize my Rpi Installation with Ubuntu.

Ubuntu on RPi - Confusions?

My goal was to have a stable ROS installation on ubuntu on RPI4 . When considering the dependencies, I realized that RPI officially supports Ubuntu 20.04 & 20.10. And as of now, the ROS version that matches with one of those ubuntu versions (Ubuntu 20.04) is ROS Noetic.

Now in ubuntu’s official download page (For RPi), they have listed the following versions. However, Ubuntu 20.04 Desktop version is not listed here. Therefore, the goal should be to install Ubuntu Server 20.04 and then install a desktop of our choice.

Figure 1: source: https://ubuntu.com/download/raspberry-pi

How this guide is organized

  1. Installing Ubuntu Server 20.04.1
  1. Installing the Desktop for Ubuntu Server
  2. Trying out screen sharing
  1. Installing ROS Noetic
  2. Installing Realsense libraries for Ubuntu 20.04

1. Installing Ubuntu Server 20.04.1

To install ubuntu server follow the official guide. When editing the file in microSD, double check whether you have edited it properly with correct wifi credentials

https://ubuntu.com/tutorials/how-to-install-ubuntu-on-your-raspberry-pi#1-overview

2. Installing the Desktop for Ubuntu Server

This is a tricky part. After searching for “how to install desktop on Ubuntu Server”, I tried the command ❌ sudo apt-get install ubuntu-desktop, which led to many errors in the desktop environment, such as Wi-Fi connections not displaying.

Therefore, we will be using a tool calledDesktopify . After you have installed ubuntu server, follow these steps to install the Desktop

git clone https://github.com/wimpysworld/desktopify.git
cd desktopify
sudo ./desktopify --de ubuntu

This will take some time to install. This script will take care of all the dependencies you need, and will install a clean desktop environment

Figure 2: After Desktopifying Ubuntu Server 20.04.1

3. Trying out screensharing

Please follow the guidehere to enable screensharing so that you can view the RPi’s desktop remotely from your Laptop.

NOTE: To connect from your computer you will first need a monitor which is plugged to the RPI4. If you want to access the screen remotely even when a monitor is not attached , Check the very end of this post.

Figure 3:

4. Installing ROS Noetic

You can follow these steps, to install ROS Noetic

http://wiki.ros.org/noetic/Installation/Ubuntu

5. Installing Realsense libraries

My friend Shalutha suggested these steps to install the required dependencies of Realsense.

RealSense installation instructions on ROS Answers.

You can copy paste these steps to an .sh file and execute it

nano realsense.sh
#copy paste the steps listed in the link to this file
chmod +x realsense.sh
./realsense.sh

Figure 4: (It will take some time to install)

Congratulations 🥳

Now you have a stable ubuntu desktop 20.04 installation!

/opt/realsense/bin/realsense-viewer

Figure 5: (Screenshot taken from the plugged monitor)

Extras

1. Logging in with an SSH key

Follow the SSH key setup tutorial linked in the original guide.

2. Accessing remote screen when a monitor is not attached.

sudo apt-get install xserver-xorg-video-dummy
sudo nano /etc/X11/xorg.conf

Copy the following configuration into that file:

Section "Device"
    Identifier "Configured Video Device"
    Driver "dummy"
EndSection

Section "Monitor"
    Identifier "Configured Monitor"
    HorizSync 31.5-48.5
    VertRefresh 50-70
EndSection

Section "Screen"
    Identifier "Default Screen"
    Monitor "Configured Monitor"
    Device "Configured Video Device"
    DefaultDepth 24
    SubSection "Display"
        Depth 24
        Modes "1024x800"
    EndSubSection
EndSection

Now reboot the RPisudo reboot. Then you can connect from your laptop even if there is no monitor attached to the RPi.

(source:https://askubuntu.com/questions/453109/add-fake-display-when-no-monitor-is-plugged-in )

Final outcome of setting up 🎉

Watch the original setup demo on YouTube.

KUDOSDon’t
Move
Thanks!