Introduction to ROS — Arduino
Arduino boards are becoming an essential ingredient in
DIY robots and electronic gadgets. There are a lot of
reasons for this, such as simplicity of programming, cost-effectiveness of the board, and great community support.
In my opinion, the main reason for the success of Arduinos
is because of the ease of prototyping. Even though there
are some ARM based boards available in the market which
can perform better than the Arduino, I don’t believe they
could win over hobbyists and DIYers.
Let’s focus on robotics. We already know that Arduinos
are being used in DIY robots, but do you think these boards
can handle all the different functions in a complex robot?
Let’s look at an example. Imagine we are going to build an
autonomous mobile robot which can map its surroundings
and navigate autonomously. Do you think the Arduino can
do this job alone? No! Because the Arduino is just a
microcontroller platform based on the AVR/ARM controller
(running 8 MHz-84 MHz), it is basically an I/O board which
can perform only a minimum amount of computation on its
own. We can’t do a computer vision application using it.
So, how can we use this board in a high-end robot? I
would say we can use it as an I/O board basically to
interface robotic sensors (such as ultrasonic sound sensors),
IMUs (Inertial Measurement Units), and actuators such as
DC motors, servos, etc. To perform high-end processing in
robots, we may need to look at PCs with software
frameworks to program robots.
ROS (Robot Operating System) is a popular robotics
software framework to work with complex robots like PR2,
Robonaut, TurtleBot, etc. These high-end robots have tons
of sensors, so processing data is a cumbersome task. ROS
provides a message passing middleware (so to speak) which
can be use to communicate with different processes/nodes.
For example, it may have a node for reading and writing to
an Arduino, and a different node for getting images from a
camera. Each of these nodes can communicate and
exchange data with each other. Now the question is how
do we interface an Arduino to ROS? How do we exchange
sensor data and control messages from the Arduino to the
ROS communication framework? Before discussing
interfacing, it’s a good idea to go through some basic
concepts of ROS. So, let’s do just that!
ROS in a Nutshell
As mentioned, ROS is a meta operating system, which
means it gives you functionality but needs a host OS to
execute. The main features of ROS are:
• Communication middleware: This middleware
allows inter-process communication between ROS
nodes/processes to exchange data. The communication is
done by a publish/subscribe mechanism, i.e., one node is
sending data and one is receiving it. The main
communication paradigms in ROS are Topics, Messages,
Services, and Parameters.
• Tools: It has a wide variety of GUI and command
line tools to visualize and debug ROS data. Some of the
tools are Rviz (ROS Visualizer) and rqt.
• Capabilities: In addition to the communication
middleware, ROS provides a wide variety of capabilities
which can be used in any robot without having deep
knowledge about it. Some of the capabilities of ROS are
Pose Estimation of robot, Localization, Mapping, and
• Ecosystem: There is an active worldwide community
for ROS development and support.
Getting Started with
By Lentin Joseph
28 SERVO 11.2016
Post comments on this section and find any associated
files and/or downloads at www.servomagazine.com