Installing Ubuntu 20.04 + ROS Noetic on Raspberry Pi 4 (without a monitor)
1. Required Equipment
Required equipment:
Raspberry Pi 4 Model B
Wi-Fi capability
MicroSD card: minimum 32GB
MicroSD to SD card adapter
(Optional) Monitor, mouse, etc.
2. Raspberry Pi Image Burner
If you don't have a monitor, you'll need to use a Raspberry Pi image burner, which you can download from the official website.
First, select the operating system, then find Ubuntu Server 20.04.5 version.
Next, configure the system initialization options: - "Enable SSH service" to enable SSH - "Set username" - "Configure Wi-Fi" (important): This will enable Wi-Fi and automatically connect to the provided network and password. Ensure this Wi-Fi network matches the one your current computer is connected to; otherwise, the rest of this tutorial won't work.
Proceed with burning and wait for completion.
3. Finding Raspberry Pi 4 IP Address
Remove the micro SD card from your computer and insert it into the Raspberry Pi 4's slot, ensuring the Pi is powered off (unplug power). Power on the Raspberry Pi 4; you should see the green LED on the Pi flashing randomly, indicating it's booting and using the SD card. If the green LED doesn't flash randomly, the burning operation might not have been successful, and you may need to burn the image again.
The Pi 4 will attempt to connect to the current Wi-Fi network with the provided name and password.
Next step is to find out what the IP address of the Raspberry Pi is in your network.
Note: If you don't see the Pi's address initially, wait at least 2 minutes before powering off/on the Raspberry Pi again.
3.1 Windows
For Windows, you can use Advanced IP Scanner .
Simply click "Scan" and wait.
You can see the IP address of my Raspberry Pi is 192.168.178.40.
3.2 Linux/Ubuntu
Typically done using nmap (if not already installed:
sudo apt install nmap
).
First, find your network IP address and subnet mask. Run the command
ifconfig
:
1 | ifconfig |
In this example, my Ubuntu host IP address is 192.168.43.138 with a subnet mask of 255.255.255.0 (24 bits).
Now, use nmap with the obtained data:
1 | sudo nmap -sP 192.168.43.0/24 |
This will reveal the Raspberry Pi's IP address: 192.168.43.56.
3.3 With a Monitor
Directly input:
1 | ip addr |
The output looks like this:
1 | 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 |
4. Connecting to Raspberry Pi
Open Terminal on Windows, simply by typing “cmd” in the Windows search bar, then “Run Command.”
4. Connecting to Raspberry Pi
To connect to your Raspberry Pi from Windows, open a terminal by typing "cmd" in the Windows search bar and launching Command Prompt. Here, I recommend using VS Code because it's very suitable for future development, and I highly recommend it.
Enter the following command:
1 | ssh pi@192.168.178.40 |
Replace "pi" with any other username you entered in the advanced settings of your Raspberry Pi image burner. Also, use the IP address you found in the previous step, not necessarily 192.168.178.40.
You'll then see something like this:
1 | The authenticity of host '192.168.178.40 (192.168.178.40)' can't be established. |
You need to type "yes" for the first question and then enter the password set in the advanced settings of your image burner.
After that, you'll see something like this:
1 | Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 5.4.0-1090-raspi aarch64) |
5. Installing ROS Noetic
Setting up sources.list
Configure your computer to accept software from packages.ros.org.
1 | sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' |
This command adds the ROS software package source to the sources.list file.
1 | sudo apt install curl # if you haven't already installed curl |
These two commands install curl (if not already installed) and import the public key for ROS software packages.
1 | sudo apt update |
This command updates the list of available packages.
Installing Desktop version
Includes all content in ROS-Base and tools like rqt and rviz.
1 | sudo apt install ros-noetic-desktop |
This command installs the ROS Desktop version, which includes all content in ROS-Base and additional tools like rqt and rviz.
1 | echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc |
These two commands add ROS environment variables to the bashrc file and load them immediately in the current session.
Install packages such as python3-rosdep, python3-rosinstall, python3-rosinstall-generator, python3-wstool, and build-essential.
1 | sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential |
This command installs commonly used ROS dependency tools and essential packages required for compilation.
Initializing rosdep
Before using many ROS tools, you need to initialize rosdep. rosdep makes it easy to install system dependencies for the source code you want to compile, and certain ROS core components require it to function. If rosdep is not installed yet, install it as follows.
1 | sudo apt install python3-rosdep |
This command installs rosdep.
Run the following commands to initialize rosdep.
1 | sudo rosdep init |
These two commands initialize rosdep and fetch the latest rosdep rules.
Testing
Next, you can run roscore to check the ROS installation.
1 | roscore |
- Title: Installing Ubuntu 20.04 + ROS Noetic on Raspberry Pi 4 (without a monitor)
- Author: xiangyu fu
- Created at : 2023-08-06 18:25:35
- Updated at : 2024-06-23 00:59:02
- Link: https://redefine.ohevan.com/2023/08/06/misc/install_ubuntu_on_raspberry_pi/
- License: This work is licensed under CC BY-NC-SA 4.0.