This is the first story of the 3-part series: ROS on Raspberry PI. I have divided the topic in 3 parts as below:
- Getting started (This story)
- Custom Dockerfile and Picamera.
- Running ROS as remote node in docker.
SSH to RPI and Install docker. For this tutorial I used latest RPI4 with 8GB ram.
# Install prerequisites
$ sudo apt-get update
$ sudo apt-get install apt-transport-https ca-certificates software-properties-common -y
$ curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh
If you get an error (E: Sub-process /usr/bin/dpkg returned an error code (1)) while running the above command then use below command instead:
curl -sSL https://get.docker.com | sh
Once it’s complete, you should see a message, something like below:
...
If you would like to use Docker as a non-root user, you should now consider
adding your user to the "docker" group with something like:sudo usermod -aG docker pi
Run the above command, logout and login again. After login run groups
command and you should docker
listed in the output.
$ groups
pi adm dialout cdrom sudo audio video plugdev games users input netdev docker gpio i2c spi
As of Fall 2020, due to an error in libseccomp, apt update throws signature error in container on arm. To overcome this download the newest version of libseccomp from http://ftp.debian.org/debian/pool/main/libs/libseccomp/libseccomp2_2.5.0-3_armhf.deb
and install it with:
$ sudo dpkg -i libseccomp2_2.5.0–3_armhf.deb
Get docker image:
$ docker pull ros:noetic-ros-base
Run docker:
$ docker run -it ros:noetic-ros-base
# if you get any error then try below command instead
# docker run --privileged -it ros:noetic-ros-base
This should start the docker container in interactive mode. Once started, source ROS and run some ROS commands to make sure that its working as expected.
$ source /opt/ros/noetic/setup.bash
$ roscore