Differential-drive Mobile Robot Controller
with ROS 2 Support
Controlador para Robot M
ovil de Tracci
on Diferencial Compatible con ROS 2
Gustavo Albarr
, Juan Nicolodi
, Dante Ruiz
, Diego Gonz
and Gonzalo Perez-Paina
Centro de Investigaci
on en Inform
atica para la Ingenier
ıa (CIII),
Facultad Regional C
ordoba de la Universidad Tecnol
ogica Nacional (UTN-FRC)
Maestro L
opez esq. Cruz Roja Argentina, X5016ZAA C
ordoba, Argentina
Abstract—Autonomous Mobile Robots, known as AMRs,
are used in the internal logistics of many types of industries
and production sectors. This type of robots replaces the
traditional Automated Guided Vehicles (AGVs). In the case
of AGVs, the path to follow is previously defined, and these
robots do not have the ability to choose a different path.
On the other hand, AMRs are more flexible, safe, and
precise, due to the incorporation of technologies reserved
until recently for research, such as autonomous navigation,
computer vision systems, and Simultaneous Localization and
Mapping (SLAM) technology, among others. Many of these
technologies are implemented using the Robot Operating
System (ROS). ROS is a set of free and open-source software
libraries and tools for building robot applications. Its new
version, ROS 2, was developed to be applied to production
environments. This paper describes the development of a
controller for a differential-drive AMR with support for
ROS 2 using its implementation for embedded systems,
micro-ROS. This controller is the evolution of a previous
version that was used in different mobile robots for over 10
years at CIII (UTN). It is worth clarifying that this work
is mainly focused on hardware development. However, some
preliminary software tests have been carried out, mainly
to evaluate the correct functioning of the differential-drive
robot controller. Firstly, the design requirements are defined,
and a microcontroller with native support for micro-ROS is
selected. Then, the development of each controller stage is
described, such as the power supply, the USB communication,
the battery voltage sensing, the debugging port, and the
final PCB design. Finally, the initial software tests that
allow verifying the correct operation of the controller and the
improvements compared to the previous version are mentioned.
Keywords: autonomous mobile robot; differential drive;
embedded controller; ROS 2; micro-ROS
Resumen—Los robots conocidos con el nombre de AMR
(Autonomous Mobile Robots) se utilizan en la log
ıstica interna
en muchos tipos de industrias y sectores de la producci
on. Este
tipo de robots sustituyen a los tradicionales AGVs (Automated
Guided Vehicles) en los cuales el camino a seguir est
a definido
previamente y no tienen la capacidad de elegir un camino
diferente. Por otro lado, los AMRs resultan m
as flexibles,
seguros y precisos, debido a la incorporaci
on de tecnolog
que hasta hace poco estaban reservadas al
ambito de la
on, tales como: navegaci
on aut
onoma, sistemas de
on por computadoras, tecnolog
ıa de SLAM (Simultaneous
Localization and Mapping), entre otras. Muchas de estas
ıas se implementan utilizando ROS (Robot Operating
System). ROS es un conjunto de bibliotecas de software y
herramientas de c
odigo abierto y libre para el desarrollo de
aplicaciones de robots, cuya nueva versi
on ROS 2 tiene como
uno de sus objetivos ser aplicable a entornos de producci
on. El
presente trabajo describe el desarrollo de un controlador para
robots de tracci
on diferencial tipo AMR con soporte para
ROS 2 utilizando la implementaci
on para sistemas embebidos
micro-ROS. Este controlador es la evoluci
on de una versi
anterior utilizada en diferentes robots por m
as de 10 a
nos en
el CIII (UTN). Vale aclarar que este trabajo est
a enfocado
principalmente en el desarrollo de hardware. Sin embargo,
se han realizado algunas pruebas preliminares de software,
principalmente, para evaluar el correcto funcionamiento
del controlador de tracci
on diferencial. En primer lugar,
se definen los requerimientos de dise
no y se selecciona un
microcontrolador con soporte nativo para micro-ROS. Luego
se describe el desarrollo de cada etapa del controlador, tales
como: la alimentaci
on, la comunicaci
on USB, el sensado de
on de bater
ıa, el puerto de depuraci
on y el dise
no final
del PCB. Por
ultimo, se hace menci
on a las pruebas iniciales
de software que permiten verificar el correcto funcionamiento
del controlador y las mejoras respecto a la versi
on anterior.
Palabras clave: robot m
ovil aut
onomo; tracci
on diferencial;
controlador embebido; ROS 2; micro-ROS
Automated Guided Vehicles (AGVs) [1] are a key com-
ponent in the internal logistics in many types of industries
and production sectors in their implementation of Flexible
Manufacturing Systems (FMSs) [2]. AGVs provide the
ability to move products and parts efficiently in relation to
handling time. The first AGVs were guided by electrical
conductors that were mounted on the ground, known as
inductive guidance [3]. Currently, the navigation [4] of
AGVs is based on magnetic and laser scanning sensors for
safety reasons [5]. However, the routes or paths to follow are
previously defined and the AGV does not have the ability
to choose a different path.
Recently, there have been important advances in au-
tonomous vehicles and their application as a service robotics
platform [6] known as Autonomous Mobile Robot (AMR)
or Autonomous Intelligent Vehicle (AIV), mainly focused
on promoting the flexibility of relocation of tasks within
factories and boosting the implementation of Industry 4.0
Revista elektron, Vol. 7, No. 2, pp. 53-60 (2023)
ISSN 2525-0159
Recibido: 02/10/23; Aceptado: 06/12/23
Creative Commons License - Attribution-NonCommercial-
NoDerivatives 4.0 International (CC BY-NC-ND 4.0)
Original Article
technologies. AMRs are more flexible than AGVs in respect
of programming and configuring the tasks they have to carry
out and the ability to work precisely and collaboratively
with human workers or other automatic platforms. Their
ability to adapt to different navigation scenarios can be
applied to reduce the kilometers that plant personnel cover
every day pushing carts to distribute products [7]. AMRs
are capable of moving from one place to another safely and
without human intervention, applying different technologies
that until a few years ago were reserved only for the
academic and research field [7], [8], such as: a) autonomous
navigation [9], map creation [10] c) 2D laser scanning
sensors, d) computer vision systems [11], e) Simultaneous
Localization and Mapping (SLAM) technology [12], among
others. Many of these technologies are implemented using
ROS [13].
ROS is a set of free and open-source software libraries
and tools (process monitoring, communication introspection,
visualization, etc.) to build robot applications [14], [15].
The ROS project began in 2007 at Stanford University
under the name Switchyard, and from 2008 onwards it
was run by a robotics research company called Willow
Garage, which developed most of the libraries and tools. In
2013, Willow Garage researchers formed the Open Source
Robotics Foundation (OSRF), which is currently in charge
of maintaining ROS.
The core of ROS is the message-passing middleware
for the communication between processes that allows data
exchange even when it is run from different computers. ROS
also provides a hardware abstraction layer on which devel-
opers can build robotics applications without worrying about
the underlying hardware. Using the hardware abstraction
layer and this message-passing middleware, different robotic
capabilities can be created, such as mapping, localization,
navigation, etc.; which are generally agnostic to the robot.
While ROS solves many of the complex problems inher-
ent in robotics, it also has some shortcomings. One of its
main limitations is that it was not developed as production
software. In addition, it has problems when working with
data networks with connection loss (e.g. in WiFi networks);
it has a main point of failure which is the ROS Master;
it does not incorporate any network security mechanism; it
is not natively supported to embedded systems; etc. These
limitations gave rise to the ROS 2 [16] [17] project. ROS 2
was built as a parallel set of packages that can be installed
alongside and interoperate with ROS 1 (for example, via
message bridges) [18].
The following use cases were taken into consideration in
the design of ROS 2: i) multi-robot teams, ii) application
in embedded systems, iii) real-time systems, iv) non-ideal
networks, v) production environment, and vi) prescribed
patterns for building and structuring systems.
It is important to note here that the architecture of a
robotic system generally includes a network of one or more
microprocessors with high computing power and multiple
microcontrollers. The latter are processing units with low
performance and computing capabilities, generally used to
access sensors and actuators, for low latency control func-
tions, to save energy (particularly in consumer applications),
and for security functions. This is why the second use case
PC communication
Boot & Reset
Fig. 1: New design of the differential-drive robot controller
(DDRC-ESP32) board with ROS 2 support.
considered is of great relevance, which allows microcon-
trollers to be included as “first-class participants” in the ROS
environment, instead of being segregated to interact through
a device driver. This implies that robotics software must be
developed on microcontrollers using the same ROS concepts
as on powerful microprocessors (CPUs). This demands that
the software on the microcontroller (µC) must be accessible
with the same development tools used in CPUs to carry
out introspection, monitoring, and configuration tasks at
ROS 1 is built on communication middleware created
specifically by ROS developers. Its functionality involves
node discovery, definition, serialization, and communication
of messages, etc. On the other hand, to cover this function-
ality, ROS 2 adopts the DDS (Data Distribution Service)
standard [19], which is an open standard for communications
used in critical infrastructures, such as military, space, and
financial systems. DDS allows ROS 2 to obtain: i) an
improvement in the security and integrity of information,
ii) support for embedded and real-time systems, iii) com-
munication between multiple robots, and iv) operations in
non-ideal network environments.
In order to integrate ROS 2 into embedded devices
with low hardware resources, the micro-ROS project was
developed [20]. This considers the following objectives: i)
seamless integration of microcontrollers with ROS 2, ii) easy
portability of ROS 2 code to microcontrollers, and iii) ensure
long-term maintenance of the micro-ROS stack. To achieve
these goals, the founding partners of micro-ROS designed
a software stack that uses the layered architecture of the
standard ROS 2 stack and integrates seamlessly with DDS.
The micro-ROS stack reuses as many packages as possible
of the standard ROS 2 stack. On the middleware layer, it
uses an open-source implementation of the eProsima’s eX-
tremely Resource Constrained Environments DDS (XRCE-
DDS) standard, named Micro XRCE-DDS [21]. On the
client library layer, micro-ROS extends the rcl (ROS 2
Client Library) using the rclc (ROS Client Library for C
language) packages to form a feature-complete client library
in C.
The present work describes the design of a control board
for a differential-drive mobile robot compatible with ROS 2
through micro-ROS (see Fig. 1). The project is license
Revista elektron, Vol. 7, No. 2, pp. 53-60 (2023)
ISSN 2525-0159