ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A answers.ros.org

Installing Ubuntu 18.04 arm64v8 on Raspberry Pi 3

bouncy
raspberrypi
arm
ros2

#1

Would anyone else like to see a arm64v8 image of Ubuntu 18.04 image for the Raspberry Pi 3 Model B? I gave a good stab at it Sunday afternoon, but got a little lost in the weeds given its been awhile since I made a 14.04 image for my old Raspberry Pi 1, and trying to catch up with the changes of things.

I have a majority of a one-line install image build script, but just can’t get over irregularities with ubuntu’s server install scripts and patching grub bootloader. My hacked together script thus far:

My goal was to make a Ubuntu image I could use to test the arm64 ROS2 Boncy binaries on, and do some profiling and testing on; as I didn’t feel like building or cross compiling ROS2 myself. But this has sort of turned into a deeper rabbit hole. Figured I’d share my stalled progress with the embedded folks here, or find out if anyone else already has a working image.

Other recent related discussions/wikis:

https://www.raspberrypi.org/forums/viewtopic.php?t=220079
https://lb.raspberrypi.org/forums/viewtopic.php?t=215438
https://wiki.ubuntu.com/ARM/RaspberryPi#Building_Raspberry_Pi_3_images


#2

I actually did spend some time getting ROS2 working on the Raspberry Pi 3b+ a few months ago. I took two different paths to get there:

  1. I recompiled all of ROS2 on the 32-bit Raspberry Pi distribution that is the default for Ubuntu 18.04. This worked fine, with the caveat that you have to build everything sequentially since some things take too much memory. I ended up using MAKEFLAGS="-j1 -l1" colcon build --executor sequential. The big downside to this approach is that the ROS2 CI doesn’t regularly build or test against 32-bit ARM, so things may not work exactly as expected.
  2. I switched the Ubuntu 18.04 distribution running on the Raspberry Pi 3b+ over to 64-bit, and then was able to install ARM64 packages. Unfortunately, this is a bit of a process (it took me about 2 hours to do). The basic steps are:
    1. Follow the instructions at https://wiki.ubuntu.com/ARM/RaspberryPi to install Ubuntu 18.04 32-bit on the Raspberry Pi 3b+ (this is a bit of a process on its own, but just follow through that guide)
    2. Once you have successfully booted the 32-bit distribution, we can start the steps to switch to 64-bit. The basic instructions for switching the processor mode and kernel over to 64-bit are also at https://wiki.ubuntu.com/ARM/RaspberryPi#Ubuntu_arm64.2FAArch64
    3. After rebooting, you’ll be running a 32-bit userland on a 64-bit kernel. To switch to a 64-bit userland, you need to manually install all of the :arm64 versions of the packages and removing the equivalent :armhf versions. I ended up starting with leaf packages and making my way towards core packages, but it may be easier to start the other way around. In any case, after dealing with some minor fallout from doing that, and rebooting, I had a full 64-bit kernel and userland that I was able to install ROS2 packages arm64 packages on.

Hope this helps a bit; let me know if you need additional information, since I elided my detailed notes here for brevity.


#3

Any reason to use ubuntu instead of debian ?

Otherwise there is a debian arm64 for raspberry pi 3 :


I do not test it for the latest pi 3b but there is a fork for it.

The installation of the OS is straight forward. Then we can install ros2 directly from the ros2 repo :

If it is on any helps…


#4

This https://1drv.ms/u/s!AvHY_kl4hMB4gQHfDAh2SYG_Q4Bt Xubuntu 18.04 installs and works pretty fine on Raspberry Pi 3 B+

Follow the instructions here: https://ubuntu-mate.community/t/aarch64-on-raspberry-pi-2-rev-1-2-3b-3b/16853
note: The installer is designed to be run from a flash usb drive and installed to another device (SD card, hard drive).

To make it lightweight, you will have to manually remove all the packages that you don’t need.


#5

I built a ROS 1 image for Turtlebot 3 on Gentoo that was 64 bit a while back, I’ll link here once I dig up the post.

I think @ruffsl was attempting to make an Ubuntu image, though, and was hoping for 64 bit.

I’ll say, however, that 64 bit arm is not necessarily a great thing on the raspberry pi… The main benefits: you get 16 more registers than 32 bit mode and you get better compiler optimizations (the pi 3 has vectorization, if you turn it on), but you only have the < 1 GB of RAM which makes doing most things in a 64 bit system quite difficult… I think this is one of the reasons the raspberry pi people don’t use 64 bit mode by default.

Don’t get me wrong: I use my raspberry pi 3 in 64 bit mode, have compiled ROS on Gentoo, and have been able to do a full GMapping demo with Turtlebot3. It’s not useless, and it’s not painfully slow. But doing any memory-intensive thing is awful.


#6

I have to concur. I don’t see the necessity for 64bit on the Pi3, the downsides outweigh any perceived benefits. FWIW there is also a semi-official Ubuntu Core 18 64bit Pi3 image but for the reasons @allenh1 and more have listed, we haven’t pursued an official release.


#7

Yes there is need for 64 bit Ubuntu for RPI.

  1. Please find Mongo DB that is made for ARM and 32 bits - hard to find ? well … 32 bit version was killed a yer or two ago, so if You need good noSQL database You need 64 bit system, same with many other tools.
    32 bits are going to go to heaven not because rpi needs it (with 1 gig ram it does not).

64 bits are needed because every one around will not continue to develope 32 bit platform version just because there is one 32 bit board that may use it…
RPI is not the only microcomputer with GPIO, there are many “fruit” like boards, that work better, with better hardware, more RAM, possible SSD’s and so on…

I had to choose another board, because making Ubuntu 64 18.4 server working on rpi is problematic and not much straight forward.
For my project and production devices we use Odroid H2 , without fighting we can use any distro, and really powerful hardware.

So if there would be “easy way” ready to flash image i would use it. And just check how many people is looking for Ubuntu 18 64 bits server for ARM on forums… really many.


#8

For future reference or for others who end up finding this thread, the beginning of this week Ubuntu released preinstalled server images for Raspberry Pi, including a 64-bit ARM image for Raspberry Pi 3.

Preinstalled server image

The preinstalled-server image allows you to unpack a preinstalled version of Ubuntu onto a target device.

http://cdimage.ubuntu.com/releases/18.04/release/

Additionally, the ubuntu wiki for Raspberry Pi has also been updated to include some more notes and setup guides for hardware acceleration, desktop GUI installation.

Ubuntu ‘classic’

These are not Ubuntu Core images, but the ‘classic’ deb based image.

https://wiki.ubuntu.com/ARM/RaspberryPi#arm64

I’ve just tested the ubuntu-18.04.2-preinstalled-server-arm64+raspi3.img.xz image on a Raspberry Pi 3B. Installing and running ROS2 Crystal from the released debian binaries for arm64 from OSRF are working well. The ros2 cli is a little slow, but that just seems to be python on arm in general. I’ve starting testing out turtlebot3 ros2 packages from source, such as the hls_lfcd_lds_driver, and it’d been smooth sailing.

The only hiccup thus far has been the bluetooth. Thankfully the broadcom brcmfmac drivers for the wifi that come preinstalled are working fine with nmtui, but the pi-bluetooth package seems to be missing. While one can manually hciattach the bluetooth device, I’m having trouble maintaining a pared connection using bluetoothctl and a ps4 controller for ros-joy due to missing dependencies. @kyrofa , would you know where I could ticket about the pi-bluetooth package?


#9

Hey @ruffsl, sorry for the delay, I was out for a few days. I asked Foundations about this, and they said to please log it right here. It is a known issue, but they would appreciate a bug. If you wouldn’t mind linking here once you’ve done so, I can give it directly to them.


#10

I’ve created a bug report for it here:

No bluetooth on 18.04 for raspi3 arm64
https://bugs.launchpad.net/ubuntu/+bug/1817133


#11

I’ve been using this image on some Raspberry Pi robots:

But it’s a somewhat crippled version of ROS, e.g. no tf and no repo to apt-get install binaries of ros-kinetic-* packages. Building all those fairly standard things from source takes ages on a Pi.

Also if the above image is installed on a Pi Zero W, the Wi-Fi doesn’t work.

I would definitely love to see an 18.04 image with full-blown ROS :slight_smile:


#12

I believe for bluetooth support, you can use the packages from raspbian, http://archive.raspberrypi.org/debian/pool/main/p/pi-bluetooth/ (some other packages may be needed). This is how the Ubiquity Raspberry Pi image works, albeit for Xenial armhf.

@dheera Ubiquity Robotics maintains a Raspberry Pi Image with Ubuntu 16.04 + ROS Kinetic available here https://downloads.ubiquityrobotics.com/pi.html. You might be interested.

Rohan
Ubiquity Robotics