Robot OS: from 0 to 1. How to setup & develop your first package.

Ubuntu terminal window

I started using Robot Operating System (ROS) for my fresh robot idea and found first steps of setting up, distribution, version control a bit frustrating. Following text is meant for beginners.

My recent workings circle around web applications, I am used to GIT + Github, automated testing, builds on Travis CI, package management tools, containers, etc. You take a lot of everyday application development services for granted these days so moving to ROS and making something production ready will require a bit of patience.

The requirements

In my case I am building autonomous system that is going to be made of components (clusters of sensors and actuators) that have their own OS and communicate with each other over TCP/IP. ROS allows me to distribute system in this way because of its own architecture which has pub/sub pattern and where horizontal scalability is achieved by having master/slave type nodes; master here acts as a hash table which allows one node to see where others are. This allows to have robot distributed on different pieces running ROS with one limitation that those have to be on the same network (as far as I know).

ROS itself is a collection of packages that are installed on top of GNU/Linux, so underlying hardware has to support it (other platforms are experimental). To make prototype cheap I’ll start by using Raspberry PI with Ubuntu Mate and will connect it to differential drive and navigation sensors.

Installation

Provided that you have GNU/Linux installed it is relatively easy to add ROS on top of it, just follow installation instructions. First thing here is the fact that you need to install operating system, then ROS, which is not fun and consumes time when you are dealing with anything but your personal computer. It is much easier to have backup images of ROS ready to be put to SD cards. To save myself some time I have created couple of those, gzipped and put them on S3 bucket; those backups have OS installed and accessible via ssh (username: pi, password: raspberry), more documentation on how to put/backup these images to SD card can be found on mini docs page.

Other way of using ROS can be with Docker image although at the time of writing they did not have images for ARM chips which Raspberry is. It could be possible to fork those from ROS repo and replace base image with something like armv7/armhf-ubuntu. On the one hand using Docker feels like an overhead because SD card could already contain an image with ROS preinstalled, on the other hand Docker image could be run on your development machine or in a test environment, you could have reproducible environment and could even run multiple Docker images representing distributed ROS architecture.

For now I will stick with SD cards that have ROS pre-installed but will need to use it later when system has multiple ROS instances running.



Thanks!