ROS¹ on Raspberry PI with docker: Running ROS as remote node in docker

Rishi
1 min readNov 22, 2020

This is the third story of the 3-part series: ROS on Raspberry PI. I have divided the topic in 3 parts as below:

Dockerfile:

Create a dockerfile using ROS image as base image.

The docker container get the hostname during boot time and it can not be changed later. Use -h option to provide the hostname. If you are planning to connect to the docker container from outside (e.g. remote ROS node) then one of the workaround is to use same hostname as host.

docker run -h raspberrypi -d -p 22:22 -p 45100:45100 -p 45101:45101 -P --name test_sshd hrushikeshd/picar:latest

Create Workspace:

mkdir -p catkin_ws/src
cd catkin_ws
catkin_make

Create your package in the src folder

source devel/setup.sh

Start ROSCORE on RPI. Add ROS_MASTER_URI environment var on docker

export ROS_MASTER_URI=http://rpi4-01:11311/

You are now ready to talk to ROS on rpi.

--

--