I had issues getting ROS2 on to RPi3. It all revolved around ArmV7 vs ARM64. All the linux distributions need to ARM64. It also has to be the latest version of Ubuntu. I tried many ways to get the latest version of Ubuntu (18.04), but then when using “apt” to install ROS2, or build ROS2 from source I always still got an error.
I then saw that RPi3 not supports Ubuntu RPi3 Server edition. Since the ROS2 on the RPi3 I do not plan to use any of the visual tools, it seemed fine to use Ubuntu Server edition.
Download Latest Ubuntu Server
There may be a newer version when you read this, so you can look here for the latest: http://cdimage.ubuntu.com/ubuntu/releases/bionic/release/
You are looking for: preinstalled-server-arm64+raspi3.img.xz
Download the latest version of Ubuntu 18.04
Create SD Memory Card with Ubuntu
Untar the image on your system.
Then burn the image to the SD card using Etcher https://www.balena.io/etcher/
Load the Ubuntu
Install the SD Card into the RPi3
Boot up the RPi3
Create a password for the ubuntu user.
Install RPI.GPIO
The current version of RPI.GPIO does not work on this version of Ubuntu because Ubuntu Server 18.04 does not list the RPI version type correctly compared to Raspbain. So you need to use a patched version.
|
|
Setup Adafruit Packages
|
|
To determine board and chip type review results of the following commands.
|
|
The list of board and chips options are in the following files:
|
|
Modify board.py
|
|
Add I2C Permissions
|
|
The default user name is “ubuntu”, so replace “ubuntu” in usermod command if are using a different user name.
Then logout and login or restart your SSH to have changes take affect. When you log back in, you will need to export your options board configuration again.
Install ROS2
Follow all the instructions here to install ROS2. I did not run into any issues.
https://index.ros.org/doc/ros2/Installation/Dashing/Linux-Install-Debians/
Test ROS2 Installation
Now to test the installation. Follow all these instructions here: https://index.ros.org/doc/ros2/Tutorials/Colcon-Tutorial/
|
|
Build the Publisher and Subcriber examples.
You can use the tab to autocomplete the ros2 commands.
Publisher
|
|
You should see an output
|
|
You will need to create an SSH connection to have a new terminal window open to start another process. Note the IP address of the RPi3 board when you logged in. Or you can use the “&” at the end of the ROS2 command to start the command in the background. You will then need to use “ps -aux” and “kill” to stop the process later.
Subscriber
|
|
You should see an output
If you see the 2 talking to each other, then everything is working