Robot Operating
System
Riadh Hajri
What is and Why
ROS?
202
ROBOT OPERATING SYSTEM (ROS)
COURSE
Learning
Outcome
▸ Understand ROS Ecosystem (topics, nodes, messages,
services, actionlib)
▸ Develop simple applications to control robot motion
▸ Understand how a position and orientation are
represented in ROS
▸ Recognize how to develop a C++/Python ROS project
▸ Develop simple computer vision programs with ROS
and OpenCV
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
Problem(s) In Robotics, before ROS
• Lack of standards
• Little code reusability
• Keeping reinventing (or rewriting) device
drivers, access to robot’s interfaces,
management of on- board processes,
inter-process communication protocols, …
• Keeping re-coding standard algorithms
• New robot in the lab (or in the factory)
start re-coding (mostly) from scratch
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
WHAT IS ROS?
ROS is an open-source robot operating system
A set of software libraries and tools that help you build robot
applications that work across a wide variety of robotic
platforms
Originally developed in 2007 at the Stanford Artificial
Intelligence Laboratory and development continued at Willow
Garage
Since 2013 managed by OSRF (Open Source
Robotics Foundation)
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
WHY ROS?
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
Robot Path
Planning
2010
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
Robot
Navigation
2010
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
Flying a
Drone
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
Robot Process Cycle
Sense TThink
HINK AC
Act
T
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
Sense
CAMERA
LASER
ULTRASOUND
SENSE
GPS
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
Thin
ARTIFICIAL
k INTELLIGENCE
MACHINE LEARNING
Think
SIGNAL PROCESSING
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
Act
BRUSHLESS MOTORS
UAV MOTORS
ACTUATORS
Act
SERVO
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
Self-Driving Car
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
ROS Impact
2M Page View per Month
120000 new users per month
SOURCE [Link]
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
ROS Impact
SOURCE: [Link]
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
ROS MAIN FEATURES
ROS has two "sides"
The operating system side, which provides
standard operating system services such as:
o hardware abstraction
o low-level device control
o implementation of commonly used
functionality
o message-passing between processes
o package management
A suite of user contributed packages that
implement common robot functionality such as
SLAM, planning, perception, vision,
Riadh manipulation, etc.
ROBOT OPERATING SYSTEM (ROS)
COURSE
ROS MAIN FEATURES
Riadh
ROBOT OPERATING SYSTEM (ROS) ROS PHILOSOPHY
COURSE
Peer to Peer
o ROS systems consist of many small programs (nodes)
which connect to each other and continuously exchange
messages
Tools-based
o There are many small, generic programs that perform tasks such
as visualization, logging, plotting data streams, etc.
Multi-Lingual
o ROS software modules can be written in any language for which a
client library has been written. Currently client libraries exist for C++,
Python, LISP, Java, JavaScript, MATLAB, Ruby, and more.
Thin
o The ROS conventions encourage contributors to create stand-
alone libraries/packages and then wrap those libraries so they send
and receive messages to/from other ROS modules.
Free & open source, community-based, repositories
Riadh
ROS WIKI
[Link]
rg/
Riadh
SOME ROBOTS USING ROS ( > 125)
Riadh
ROS CORE CONCEPTS
Nodes
Messages and
Topics
Services
Actions
ROS Master
Parameters
Packages and
Stacks
Riadh
ROS NODES
Single-purposed executable programs
oe.g. sensor driver(s), actuator
driver(s), map building, planner,
UI, etc.
Individually compiled, executed, and
managed
Nodes are written using a ROS client
library
o roscpp – C++ client library
o rospy – python client library
Nodes can publish or subscribe to a
Topic
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
ROS Publisher/Subscriber
Reference Book: ROS Robot Programming (in English).
Authors: Yoonseok Pyo, Hancheol Cho, Leon Jung,
Darby Lim
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
ROS Services
Reference Book: ROS Robot Programming (in English).
Authors: Yoonseok Pyo, Hancheol Cho, Leon Jung,
Darby Lim
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
ROS
ActionLib
Reference Book: ROS Robot Programming (in English).
Authors: Yoonseok Pyo, Hancheol Cho, Leon Jung,
Darby Lim
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
Development
Environment
▸ ROS Melodic on Ubuntu 22.04 (VM or Physical
Machine)
▸ Laptop recommended requirements
▸ 8 GB of RAM
▸ SSD Hard drive
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
WHAT IS ROS?
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
ROS (1) Evolution
- May 23, 2018 - ROS Melodic
■ %FD , - 3FMFBTF PG 304 .
■ 4FQ , - 304$PO ($BOBEB)
■ MBZ , - 3FMFBTF PG LVOBS LPHHFSI F BE
■ MBZ , - $ I B OHFE OBNF GSP N 043F UP 0QFO 3PCPUJDT
■ 0DU , - 304$PO (4PVUI KPSFB)
■ MBZ , - 3FMFBTF PG KJOFUJD KBNF
■ 0DU , - 304$PO ((FSNB OZ) F * ( 6 3 & 2-7 3 0 4
7FSTJPOT(IUUQ://[Link]/)
■ MBZ , - 3FMFBTF PG +BEF 5VSUMF
■ 4FQ , - 304$PO $POGFSFODF (6.4.)
■ +VM , - 3FMFBTF PG *OEJHP *HMPP
■ +VO , - 304 KPOH $POGFSFODF ( ) POH KPOH)
■ 4FQ , - 3FMFBTF PG ) ZESP MFEVTB
F * ( 6 3 & 2-8 5VSUMF JDPOT GPS FBDI WFSTJPO
■ MBZ , - 304$PO $POGFSFODF ((FSNB OZ) PG 3 0 4
■ FFC , - 0QFO 4PVSDF 3PCPUJDT FPVOEBUJPO UBLFT PO EFWFMPQNFOU/NBOBHFNFOU
■ %FD , - 3FMFBTF PG (SPPWZ (BMBQBHPT
■ MBZ , - 304$PO $POGFSFODF (6.4.)
■ AQS , - 3FMFBTF PG FVFSUF
■ AVH , - 3FMFBTF PG &MFDUSJD &NZT
■ MBS , - 3FMFBTF PG %JBNPOECBDL
■ AVH , - 3FMFBTF PG $ 5VSUMF
■ MBS , - 3FMFBTF PG BPY 5VSUMF
■ +BO , - 3FMFBTF PG 304 .
■ /PW , - 8JMMPX (BSBHF TUBSUT EFWFMPQNFOU VOEFS UIF OBNF ˎ304ˏ
■ MBZ , - 4XJUDIZBSE 1SPjFDU, MPSHBO 2VJHMFZ, 4UBOGPSE A* LAB, 4UBOGPSE
6OJWFSTJUZ
■ - 1MBZFS/4UBHF 1SPjFDU, BSJBO (FSLFZ, 6OJWFSTJUZ PG 4PVUIFSO $BMJGPSOJB (64$)
F * ( 6 3 & 2-9 3 FDFOU 3 0 4 WFSTJPOT BOE FOE PG TVQQPSU EBUF
Reference Book: ROS Robot Programming (in English). Authors: Yoonseok Pyo, Hancheol Cho, Leon Jung, Darby Lim
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
ROS (1) Evolution
- May 23, 2018 - ROS Melodic
■ %FD , - 3FMFBTF PG 304 .
■ 4FQ , - 304$PO ($BOBEB)
■ MBZ , - 3FMFBTF PG LVOBS LPHHFSI F BE
■ MBZ , - $ I B OHFE OBNF GSP N 043F UP 0QFO 3PCPUJDT
■ 0DU , - 304$PO (4PVUI KPSFB)
■ MBZ , - 3FMFBTF PG KJOFUJD KBNF
■ 0DU , - 304$PO ((FSNB OZ) F * ( 6 3 & 2-7 3 0 4
7FSTJPOT(IUUQ://[Link]/)
■ MBZ , - 3FMFBTF PG +BEF 5VSUMF
■ 4FQ , - 304$PO $POGFSFODF (6.4.)
■ +VM , - 3FMFBTF PG *OEJHP *HMPP
■ +VO , - 304 KPOH $POGFSFODF ( ) POH KPOH)
■ 4FQ , - 3FMFBTF PG ) ZESP MFEVTB
F * ( 6 3 & 2-8 5VSUMF JDPOT GPS FBDI WFSTJPO
■ MBZ , - 304$PO $POGFSFODF ((FSNB OZ) PG 3 0 4
■ FFC , - 0QFO 4PVSDF 3PCPUJDT FPVOEBUJPO UBLFT PO EFWFMPQNFOU/NBOBHFNFOU
■ %FD , - 3FMFBTF PG (SPPWZ (BMBQBHPT
■ MBZ , - 304$PO $POGFSFODF (6.4.)
■ AQS , - 3FMFBTF PG FVFSUF
■ AVH , - 3FMFBTF PG &MFDUSJD &NZT
■ MBS , - 3FMFBTF PG %JBNPOECBDL
■ AVH , - 3FMFBTF PG $ 5VSUMF
■ MBS , - 3FMFBTF PG BPY 5VSUMF
■ +BO , - 3FMFBTF PG 304 .
■ /PW , - 8JMMPX (BSBHF TUBSUT EFWFMPQNFOU VOEFS UIF OBNF ˎ304ˏ
■ MBZ , - 4XJUDIZBSE 1SPjFDU, MPSHBO 2VJHMFZ, 4UBOGPSE A* LAB, 4UBOGPSE
6OJWFSTJUZ
■ - 1MBZFS/4UBHF 1SPjFDU, BSJBO (FSLFZ, 6OJWFSTJUZ PG 4PVUIFSO $BMJGPSOJB (64$)
F * ( 6 3 & 2-9 3 FDFOU 3 0 4 WFSTJPOT BOE FOE PG TVQQPSU EBUF
Reference Book: ROS Robot Programming (in English). Authors: Yoonseok Pyo, Hancheol Cho, Leon Jung, Darby Lim
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
ROS Distribution over
ROS 2.0
Time
ROS
ROS2
ROS
SOURCE: [Link]
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
ROS
Archiecture
Node Node
1 2
ROS
Maste
r
Client
Libraries
(rospy,
roscpp)
TCPROS/UDPROS
Linux
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
ROS
Concepts
Reference Book: ROS Robot Programming (in English).
Authors: Yoonseok Pyo, Hancheol Cho, Leon Jung,
Darby Lim
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
ROS
Concepts
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
Path
Planning
Global Path Planner
Local Path Planner
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
LIMITATIONS OF ROS
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
ROS
Limitations
!
Not Real-Time Need Reliable Network
Single Robot Single Point of Failure
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
ROS v ROS 2.0
s
Node Node
1 2
Node 1 Node 2 Node
ROS 3
Maste
r
Client
Client
Libraries
Libraries
(rclpy, rclcpp)
(rospy, Abstract DDS
roscpp)
TCPROS/UDPROS
DDS Intra-Process API
Linu Linux/Windows/Mac-OS
x
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
ROS2 Use Cross-Platform
Cases
Fast Prototyping
Robotics Swarm QoS and Real-Time to Production
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
What Middleware to
Choose?
Two options
Build new middleware
Improve ROS 1.x Transport
based on existing
solutions
Protoco
ZeroM
l
Q
Buffers
DD
ZeroCon
S
f
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
Data Distribution
Service
▸ An industry-standard communication
system “The DCPS model described in this
chapter extends the publish-subscribe
model to address the specific needs
of real-time, data-critical
▸ Designed by Object Management Group applications.”
▸ Real-time
▸ machine-to-machine
Data-Centric (middleware)
Publish Subscribe (DCPS) communication
system
▸ Uses publish-subscribe pattern
▸ Used in: financial trading, air-traffic control, smart grid
management, big data and IoT applications
▸ Started in 2001 with two vendors: RTI in the US and Thales
group in France
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
Data Distribution
Service
[Link]
watch?v=u-saogMmKOo
2011
Riadh
ROBOT OPERATING SYSTEM (ROS) COURSE
Why DDS? Messag
Discovery
▸ DDS is a networking
e
▸ ROS2 maintains the same
▸ DDS replaces the ROS
middleware message definitions as in
master discovery ROS1
▸ Simplifies complex system
Implements
▸ network a publish–
programming ▸ ROS 1.x .msg files are
subscribe pattern for
sending and receiving data, ▸ DDS API provides converted into .idl files
to be used by DDS
events, and commands information on
among the nodes. transport layer
nodes topics,
▸ Similar to ROS, (publishers)
services, etc. ▸ Experiments show that cost
create "topics" (e.g., of message conversion is
temperature, location, non significant as
▸ Users are prevented
pressure) and publish compared to cost of
“samples"
from direct access to serialization.
DDS (hidden behind
▸ DDS allows the user to ROS APIs)
specify quality of service
(QoS) parameters (QoS
Profiles in ROS2) ▸ Fully distributed
Riadh discovery process
(no single point of
ROBOT OPERATING SYSTEM (ROS)
COURSE
No Vendor Lock
There is currently support for eProsima FastRTPS,
ADLINK’s OpenSplice, RTI’s Connext DDS and
CycloneDDS.
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
ROS2 Distribution/Learning ROS 2
loquent Elusor
Nov 22nd, 2019 Foxy Fitzroy
June 5th, 2020
Dashing Diademata
May 31st, 2019
Crystal Clemmys [Link]
December 14th, 2018
Bouncy Bolson
July 2nd, 2018
Ardent Apalone
December 8th, 2017
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
Using ROS in
Education
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
Using ROS in
Education
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
Using ROS in
Education
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
Using ROS in
Education
[Link]
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
COROS: Multi-Robot Collaboration
Architecture Global and local interactions COROS components
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
Range Limitation of
WLAN
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
Moving ROS to the
Cloud
Robot
dron
e
Clou
d
Leverage the use of cloud computing
Riadh and IoT
ROBOT OPERATING SYSTEM (ROS)
COURSE
The Single Robot
Problem
ROS
Master
ROS
Master
ROS
Master
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
Scalability issue with ROS
Master
ROS
Master
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
ROSLink
ROSLink Bridge
ArchiectureROSLink ROS
ROSLink
Master
Message
Message
ROSLink
ROSLink
ROSLink ROSLink Bridge
Message
Cloud Message ROS
Proxy Master
ROSLink
ROSLink
ROSLink Bridge
Message
Message ROS
Master
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
ROSLink
ROSLin
k
Cloud
ROSLin ROSLin ROSLin
k k k
Client Proxy Bridge
Contro
ROSLin
l, ROS
k
Monito
Cloud driver
r App s
Robot
HW
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
Controlling a drone over the
Internet
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
5G Robot Teleop using ROS
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
Platooning using
ROS
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
Learning ROS BASICS
Path
MOTION WITH
ROS
PERCEPTIO
PERCEPTION I: N I:
OPENCV LASERSCA
NNER
ROSSERIAL
ARDUINO
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
Learning ROS
Path TRANSFORMATION
S
REACTIVE
NAVIGATION
MAP-BASED
NAVIGATION
AERIAL
ROBOTS
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
Learning
Path
Riadh
ROBOT OPERATING SYSTEM (ROS)
COURSE
LEARNING OUTCOMES
Riadh
[Link]