ROS Tutorials to Start Working with Arduino and Raspberry Pi

The robotic field is getting more and more complex, but there’s no need to worry since an army of engineers works to build an entire fleet of software and hardware to solve the problems that may appear. The integration of an enormous amount of sensors and actuators could be a real problem that is transferred also to the area of algorithms and to the hardware platforms dedicated to integrating robotic components.

The Robot Operating System (ROS) is engineered to solve the problems from the software side. It contains a series of libraries that support a wide range of sensors and actuators, you’re allowed to write a ROS driver for your sensor, it has a good integration with other robot middleware software like OpenCV, Point Cloud Library, etc., and it can run on single board computers such as Raspberry Pi or BeagleBone Black, or integrated with single boards based on microcontrollers such as the Arduino.

Most commercial robots support ROS, and now you can design your own robot based on Arduino or Raspberry Pi and run the Robot Operating System.

What is ROS and why you should use ROS in robotics?

ROS in robotics

ROS in robotics [image source]

The time is a very important resource and any tools that help you to develop a complete solution timely and with minimum resources is a maneuver to choose and run on the shortest path to the final project. The ROS library can help you to implement algorithms and cut down the time required to integrate an entire bag of components, it has support for parallel computing and provide you all the features and benefits of a complete OS.

From the development side, the ROS support a long list of development tools with the help of a large community of hobbyists that can share with you some tips and tricks, or any tutorial that can help you to discover the world of robots that run ROS.

Why you should use ROS in robotic applications?

Examples of ROS and Raspberry Pi [image source]

ROS in robotics[image source]


The implementation of a plethora of sensors and actuators quickly and in a custom way is a rough work. With a good hardware support, the ROS can work with a wide range of sensors, actuators, and even for whole robotics platforms.

With a modular structure, the development of a robot system can be done as teamwork where everyone can work separated from each other.

Working as a meta-operating system for robots, the ROS has many algorithms already implemented and available as packages, it provides hardware abstraction, message-passing, package management, visualizers, device drivers, and several other tools.

It can serve the data received from sensors to different sub-programs at the same time, and this is the benefits of the parallel computing, which is more difficult to program than sequential ones due to the potential of software bugs that may occur.

The Robot Operating System is an open-source and free meta-operating system. In other words, the ROS run under the BSD license, is built on the top of an operating system, and allows different processes to communicate with each other at runtime.

The ROS operating system can easily integrate standard C++ libraries like OpenCV, Qt, or Point Cloud Library, and can be installed on single board computer such as Raspberry Pi.

Arduino and Raspberry Pi are the most popular embedded systems in robotics, and I choose these two platforms to explain how these embedded platforms can be integrated with ROS and help you to discover the first application.

The main topics covered in this article are:

  • how to setup the ROS to run with an Arduino board on several operating systems;
  • the “Hello World” example using the ROS and Arduino;
  • tutorials and examples how to use the ROS together with Arduino;
  • how to setup the ROS on Raspberry Pi and several operating systems;
  • tutorials and examples how to use the ROS together with Raspberry Pi;

The ROS is built to run on several operating systems in order to cover a large area of use. Starting with the well-known Linux based operating system such as Ubuntu, and up to Windows and OS X, the ROS can be unleashed to run on commercial robots as well as DIY robots built at home.

The list of operating system supported by ROS:

  • Ubuntu
  • Ubuntu ARM
  • OS X
  • OS X (MacPorts)
  • OpenEmbedded/Yocto
  • Debian
  • Arch Linux
  • Windows
  • Ångström
  • UDOO

ROS and Arduino

ROS and Arduino

ROS and Arduino [image source]


Arduino is a quite attractive embedded platform among hobbyists from several reasons including here the low price, an easy way to interface different sensors and actuators, a large community that share information and resources, and of course it can be interfaced with ROS using the rosserial node.

With no extra effort, you can control an advanced robot without writing a single hardware drive, only by setting up a network of custom ROS center nodes. You can use the ROS with Arduino for a wide range of applications such as monitoring, measuring the values from a sensor, control R/C servos, and many other applications with support from ROS side.

Tools to use ROS with Arduino
It is very easy to use the ROS with Arduino. Between the Arduino and ROS is the Arduino IDE tool designed for a quickly and easily programming hardware. The communication between ROS and Arduino is done through rosserial_arduino package, which provide a ROS communication protocol able to work with Arduino’s serial ports.

The rosserial_arduino package is a dedicated tool engineered to work directly with ROS messages, get the ROS system time, or publish TF transformer.

Tutorials to setup ROS for Arduino

The open-source Robot Operating System is a well documented framework that help you to explore all the features and functionalities on a long list of operating systems. You have available step-by-step all the information to setup the ROS in minutes on Linux, Windows, or Mac OSX and start using the ROS OS with Arduino.

Here are the tutorials to setup the ROS for Arduino single board microcontroller:

  • Setup the Arduino IDE and rosserial on different operating systems for Arduino – this tutorial show you in general how to setup the Arduino IDE to use rosserial for different operating systems including ROS installation for Windows users;
  • From this tutorial you can learn how to setup a virtual machine with Ubuntu and ROS on Windows machine;
  • This tutorial show you in details how to setup ROS and Arduino IDE on Mac OS X;

Examples of ROS and Arduino

The “Hello World” example
Every new project starts with a “Hello World” example, and the best way to enter into the world of ROS and Arduino is also to build the “Hello World” application. Here is the tutorial that shows you how to run the first application for ROS and Arduino using the rosserial.

In the following, I explore several other tutorials that can be used for inspiration and to find information about how to use the ROS framework and Arduino board.

  • From beginning, you can start using this series of ROS tutorials for beginners that uses rosserial_arduino tool for a long list of applications;
  • Arduino Double Sonar With ROS – this example show you how to use the Arduino together with ROS and build a simple double sonar application with PING))) sensors;
  • Sending Data from Arduino to ROS – a comprehensive tutorial from where you can start digging to find how the Arduino board send data to the ROS;
  • Android + Arduino + ROS – with this video presentation, you enter in the area of advanced applications where a ROS compatible robot based on Arduino board can be controlled via an Android device;
  • ROS on Raspberry Pi

    ROS on Raspberry Pi

    ROS on Raspberry Pi [image source]


    The ROS operating system is designed to run on a network of machines and has support for simultaneous execution of a program or multiple computational threads. Back to Raspberry Pi, the official operating system for Pi is a version of Debian, followed by a list of operating systems also supported by RPi.

    Official information claims Ubuntu as official operating system supported by ROS, by in an experimental way, several other operating systems can run ROS without any problems. The Debian and Arch Linux, two of the better choice operating systems that can run on the RPi, can be the best solutions to build Raspberry Pi robots with the ROS operating system.

    In the following, I start a list with tutorials from where you can learn how to setup ROS on different operating systems supported by Raspberry Pi.

    Examples with ROS and Raspberry Pi

    You can start building applications with ROS and Raspberry Pi using the comprehensive documentation and the community behind ROS, or using simple ROS tutorials for beginners as inspiration.

    You can build with ROS and RPi a lot of robotic projects such as intelligent quadcopters, telepresence robots, security robots, and the list can continue. In the following, I explore several examples from where you can learn how to use in projects the ROS operating system with Raspberry Pi.

    • rosserial_embeddedlinux – on this page you can find several examples to start building you first application called “Hello Ros” and up to advanced technique that can be applied for ROS;
    • ROS Tutorials – another series of tutorials and examples from where you can learn how to use the ROS at maximum power(with Raspberry Pi, of course!);
    • RaspberryPI Ros – this tutorial cover the complete process to connect TakkTile sensors to the Raspberry PI directly using the I2C bus;
    • (link not available)AR.Drone 2 with ROS and OpenCV: Get started quick with Ubuntu or Mint – this is a really comprehensive article from where you can find how to install ROS, how to use it with OpenCV, and how to make a drone to fly using a joystick;
    • Raspberry Pi + Wifi Dongle + Usb Webcam = remote control web bot – this is an example how to build a tracked robot able to be controlled over wireless connection and uses a webcam to capture images;
    • ROS by Example: Head Tracking in 3D (Part 2) – with this example you enter in the area of advanced projects where the ROS framework is used to track 3D points by smoothly panning and tilting the camera;

    Resources:
    ROS, http://students.iitk.ac.in/;
    RasPi Interface, Github;

  • Posted in: ROS

Commerce Content is independent of articles and advertising, and if you buy something through our posts, I may get a small share of the sale.

1 comment » Write a comment

Leave a Reply

Required fields are marked *.