ROS on a Raspberry Pi 3B+

UPDATE: Ubuntu MATE 18.04 image for Raspberry Pi now available https://ubuntu-mate.org/raspberry-pi/

Ubuntu & ROS (Robot Operation System)

After reading up on different Linux distros (whoa, that's a rabbit-hole!), I installed and tried a few before settling on Ubuntu MATE. I chose it because it has a large community, lots of support, examples etc and will run on a Rasberry Pi. I preferred the MATE desktop over the standard Ubuntu one too. I installed Ubuntu MATE on an old netbook for development purposes, then ended up dual-booting with it on my old main laptop too, then of course set about installing it on the shiny-new RPi3B+ that I recently purchased...

At the time of writing, the RPi3B+ will not run most Linux distros. That's the "B+", the "B" is fine. The architecture of the two are different and the B+ will only run Raspbian out of the box, a fact that isn't immediately obvious until you start looking into it. I had assumed that I could get the latest Ubuntu image (Bionic 18.04) and install the lastest ROS distibution (Melodic).

Ubuntu MATE & ROS Kinetic on a Raspberry Pi 3B+?
Ubuntu MATE & ROS Kinetic on a Raspberry Pi 3B+?

As I understand it; Ubuntu MATE (16.04) is available for RPi2 and RPi3 but not the B+ and ROS Kinetic is available for Ubuntu Xenial 16.04 on the "armhf" architecture (Pi), but not for Debian-armhf. The latest ROS Melodic only supports Ubuntu Bionic. Kinetic is supported until April 2021, so shouldn't be a problem, but there's no Xenial/16.04 image for the Raspberry Pi 3B+. Xenial's support ends April 2019, Bionic/18.04 ends April 2023. So Bionic for armhf would be the better choice, if it existed.

Ubuntu MATE 16.04 on a RPi3B+

Method 1 (not recommended)

My first attempt followed the early advice I discovered through various articles, posts and videos. I was trying to understand the whole ecosystem and, though I did get Ubuntu MATE running on my RPi3B+, it wasn't perfect. The short version is:
  1. Download the 3 image and flash to µSD. 
  2. Put µSD card into an RPi2 or 3 (not B+) then boot and setup.
  3. Swap µSD card to RPi3B+ and continue setup and run all kinds of updates.
I actually did it twice; trying to pay more attention to exactly what was happening the second time. I also installed RPi firmware updater: sudo curl -L --output /usr/bin/rpi-update https://raw.githubusercontent.com/Hexxeh/rpi-update/master/rpi-update && sudo chmod +x /usr/bin/rpi-update. From Hexxeh on Github. Updated with sudo rpi-update.I didn't get much chance to see how well rpi-update worked as further reading (trawling through forum posts) led me to another, better, method.

Method 2

Thanks to MaxVMH and everyone over on the Raspberry Pi forums for doing the leg-work and even summarising the steps quite nicely:
"They are all in this thread, scattered around on 5 pages. So here's a nice summary :-)
(Let us know in case I forgot something.) 
Copy the following files from Raspbian to Ubuntu Mate: 
For Booting: copy bootcode.bin, fixup.dat, start.elf, bcm2710-rpi-3-b-plus.dtb and kernel7.img 
For keyboard/mouse: copy /lib/modules/4.9.80-v7+ (root partition) 
For network: copy the contents of /lib/firmware/brcm/ (root partition)

If you want to boot from USB: 
edit cmdline.txt, change root=/dev/mmcblk0p2 to root=/dev/sda2 (boot partition) 
edit etc/fstab, change/dev/mmcblk0p2 to sda2 and /dev/mmcblk0p1 to sda1 (root partition) 
Torrents of the Ubuntu Mate image with the changes already done (these are not official, I made these so use at own risk):
This one is for SD cards 
This one is for USB drives
All that and also fixup_x.dat , start_x.elf for those who would like to use the camera."

So that's what I did. And it worked :-D (haven't done USB booting or camera bits yet as I have no need right now).

Wait...

For both methods I still had to use my netbook with gparted to enlarge boot partition to ~100MB in order to satisfy the update requirements (according to the pop-up message that complained).
Updates work fine after resizing.

Firefox is broken and I want a browser to copy the ROS installation commands from, just because it's easier, so: apt-cache search chrome browser returns a list containing chromium-browser. Good enough for me. Install with sudo apt install chromium-browser.

Now install ROS

Install ROS Kinetic with the usual installation instructions.

Ubuntu MATE 18.04 on a RPi3B+?

After some more reading, I found this in the Ubuntu MATE Bionic final release notes:
Raspberry Pi images
"We’re planning on releasing Ubuntu MATE images for the Raspberry Pi after that 18.10 release is out, in October 2018. It takes usually takes about a month to get the Raspberry Pi images built and tested, but we’ve encountered some challenges with the 18.04 based images which has delayed their release. Hopefully we’ll have something in time for Christmas 2018 :-)"
I've got to a stage where I have ROS working on a RPi3B+ so I can move on, but I will probably swap to the official image when it's available.

I have also considered swapping to a LattePanda or similar when I get to the stage where I need the extra grunt. As it uses the x86 architecture it will run the full-fat Ubuntu.

If I've got anything wrong here, please let me know in the comments!


April 2019 update: https://ubuntu-mate.org/blog/ubuntu-mate-bionic-beta1-raspberry-pi/

UPDATE: Ubuntu MATE 18.04 image for Raspberry Pi now available https://ubuntu-mate.org/raspberry-pi/

Comments

  1. did you get it working on ubuntu mate 18 in the end? I'm putting mine together now, I haven't found someone saying it works yet...

    ReplyDelete
    Replies
    1. Last time I checked the release notes there hadn't been any updates. I just checked again and it still says it's planned for Christmas 2018!?! I'm not using it in anger yet either (still working on other areas).

      Delete
  2. the links for the sd card version, and the usb drivers aren't working for me. did you upload them on any other link, or where can I get them ?

    ReplyDelete
    Replies
    1. Sorry, they were just links to the original post, someone else's. Looks like they're no longer available.

      Delete
    2. can you link me to the original post, or was it deleted also ?

      Delete
    3. The original is linked right below the excerpt. FRom the RPi forum.

      Delete

Post a Comment

Popular Posts