You are on page 1of 12

NATIONAL INSTITUTE OF TECHNOLOGY KARNATAKA

Surathkal, Mangalore - 575025


EE430: Robot Dynamics and Control Laboratory
Department of Electrical and Electronics Engineering,
July - November, 2023

Week 02: ROS - Introduction & Installation

1. Introduction
Before we begin, take a look at this video (https://www.youtube.com/watch?v=oieffIypkoU)
of a mobile robot equipped with a LiDAR sensor, using which the robot follows the wall. The
small video in the right corner visualizes the live LiDAR point cloud data from the robot.

Now, in this video (https://www.youtube.com/watch?v=Sb9Ap8X50mk), the


OpenMANIPULATOR-X robot arm is attempting to hit the detected ball (in the bottom left
robot’s camera view). The actual robot is seen on the right and the simulation is in the
background, both moving hand-in-hand.

Finally, this video (https://www.youtube.com/watch?v=8iNPaWYHaZs) shows a simulated


industrial warehouse consisting of two UR10 robot manipulators (Universal Robots) working
to fulfill an order to contain a kit of a purple pump, red battery, green sensor and an orange
regulator.

In the above videos, 3 different scenarios were seen: one, where a physical robot exists and
sensory data needs to be visualized and further processed to take decisions; two, where both
a physical robot and its simulation are simultaneously controlled in near real-time; third, an
entirely simulated world with robots and sensors, in the absence of any real hardware. The
common element in these videos is that these robots/simulations are powered by ROS (Robot
Operating System), thereby highlighting its capabilities!

1.1. What’s In a Name?

By now, it is understood that ROS stands for Robot Operating System. So, is it an operating
system like Windows or macOS? Why install Ubuntu then? This question is reminiscent of the
old comical remark by a character in one of Tinkle’s comics, “Does Mysore Bonda have
Mysore in it?”.

Document prepared by: Adarsh Malapaka (NITK EE Batch of 2020)


NATIONAL INSTITUTE OF TECHNOLOGY KARNATAKA
Surathkal, Mangalore - 575025
EE430: Robot Dynamics and Control Laboratory
Department of Electrical and Electronics Engineering,
July - November, 2023

Fig. 1: What’s in a name?

IEEE’s International Conference on Robotics and Automation (ICRA) is a prestigous conference


wherein robotics researchers and industrial representatives discuss latest innovations in
robotics. According to the ICRA 2009 paper on ROS:

“ROS is not an operating system in the traditional sense of process management and
scheduling; rather, it provides a structured communications layer above the host operating
systems of a heterogeneous compute cluster”

Although it displays some features of an OS, it still depends on the underlying OS for a lot of
its functionality and thereby the need to install Ubuntu. Since ROS is meant for collaborative
research and development, its open nature is complemented by using it on an open-source
OS - Ubuntu! Support for other OSs like Windows and macOS is generally limited and on an
experimental basis (more details in the installation section below).

In short, ROS is not an Operating System and you cannot install it on your PC/laptop as a
‘standalone’ OS. A further discussion of Operating Systems is out of scope of this course, but
you could explore further if you’re interested.

1.2. ROS

If you’re still confused as to what category ROS fits into, the following provides a complete
definition of ROS by Brian Gerkey, one of the main developers of ROS.

Document prepared by: Adarsh Malapaka (NITK EE Batch of 2020)


NATIONAL INSTITUTE OF TECHNOLOGY KARNATAKA
Surathkal, Mangalore - 575025
EE430: Robot Dynamics and Control Laboratory
Department of Electrical and Electronics Engineering,
July - November, 2023

Fig. 2: The ROS Equation

★ Plumbing: ROS provides publish-subscribe messaging infrastructure designed to


support the quick and easy construction of distributed computing systems.

★ Tools: ROS provides an extensive set of tools for configuring, starting, introspecting,
debugging, visualizing, logging, testing, and stopping distributed computing systems.

★ Capabilities: ROS provides a broad collection of libraries that implement useful robot
functionality, with a focus on mobility, manipulation, and perception.

★ Ecosystem: ROS is supported and improved by a large community, with a strong focus
on integration and documentation. ros.org is a one-stop-shop for finding and learning
about the thousands of ROS packages that are available from developers around the
world.

In short, ROS is a flexible framework for writing robot software. It is a collection of tools,
libraries, and conventions that aim to simplify the task of creating complex and robust robot
behavior across a wide variety of robotic platforms.

IMPORTANT: In the previous sections and in subsequent discussions in this course, our usage
of ROS refers to ROS1 and not to ROS2 which is a newer version/project that aims to leverage
the pros of ROS1 while improving the disadvantages.

Document prepared by: Adarsh Malapaka (NITK EE Batch of 2020)


NATIONAL INSTITUTE OF TECHNOLOGY KARNATAKA
Surathkal, Mangalore - 575025
EE430: Robot Dynamics and Control Laboratory
Department of Electrical and Electronics Engineering,
July - November, 2023

1.3. Origin Story

Since we’ve developed a general idea of what ROS is, it is imperative to know the origin story
of ROS and realize why a couple of PhD students felt the need for it in 2007. This story
(https://spectrum.ieee.org/the-origin-story-of-ros-the-linux-of-robotics) has been very
beautifully written by Keenan Wyrobek, one of the creators of ROS. The below picture has
been taken from the same article and is a fun depiction of how robotics research progressed
in the early 2000s.

Fig. 3: The Robotics Research Cycle

Document prepared by: Adarsh Malapaka (NITK EE Batch of 2020)


NATIONAL INSTITUTE OF TECHNOLOGY KARNATAKA
Surathkal, Mangalore - 575025
EE430: Robot Dynamics and Control Laboratory
Department of Electrical and Electronics Engineering,
July - November, 2023

1.4. Features

★ ROS is General

Although this course shall primarily deal with robot arms/manipulators and their simulation,
the same implementations can be applied to other types of robots such as mobile and aerial
robots. Knowledge of the underlying method of communication between different ‘nodes’ of
the robotic system shall enable easy code reuse and setting up new parts of a different
robotics project.

★ Packages, Libraries and Tools

Fig. 4: ROS robotic applications

ROS provides many off-the-shelf packages for most robotic applications. For instance, sensors
such as LiDAR and Microsoft Kinect become plug-and-play using respective packages and
drivers built into ROS. Well-known algorithms in fields of motion-planning and computer
vision have already been implemented in the form of ROS packages by other
researchers/roboticists. In addition to packages, ROS has simulation tools, such as RViz, to
visualize robots and sensor data. Physical effects (such as gravity, friction, etc) to the
environment and robot can be simulated using Gazebo.

★ Language Agnostic

Document prepared by: Adarsh Malapaka (NITK EE Batch of 2020)


NATIONAL INSTITUTE OF TECHNOLOGY KARNATAKA
Surathkal, Mangalore - 575025
EE430: Robot Dynamics and Control Laboratory
Department of Electrical and Electronics Engineering,
July - November, 2023

Fig. 5: ROS is language agnostic

ROS can be implemented in any modern programming language with pre-existing


implementations in Python (rospy), C++ (roscpp), Lisp (roslisp) and libraries to bridge with
Java (rosjava) and JavaScript (roslibjs or rosnodejs). As a result of which, communication
between a Python node and a C++ node in a robotic setup is possible, hence promoting
reusability and co-working. For the sake of simplicity, we will restrict our discussions to
Python implementations in this course.

★ Uniformity

Fig. 6: Unsolicited metric system comic

ROS has a set of standard message formats to represent data of common use cases in robotics
such as for geometric concepts like positions, orientations, and vectors; for sensors like
cameras, IMUs and lasers; and for navigation data like odometry, paths, and maps; among

Document prepared by: Adarsh Malapaka (NITK EE Batch of 2020)


NATIONAL INSTITUTE OF TECHNOLOGY KARNATAKA
Surathkal, Mangalore - 575025
EE430: Robot Dynamics and Control Laboratory
Department of Electrical and Electronics Engineering,
July - November, 2023

many others. A common set of units and conventions are used to send numeric data over
these ROS messages (remember NASA’s Mars Orbiter Mission debacle?).

★ Open Source

One of the greatest strengths of ROS is that it's open source. Most of the core packages are
released under a BSD license. A BSD license allows you to modify and use the code for
commercial purposes, without having to release your code with an open source license.

★ Online Community

The existence of a huge user base for ROS consisting of researchers, industry experts and
hobbyists contributing to ROS packages encourages collaborative robotics software
development wherein one laboratory proficient in mapping indoor environments could
contribute a world-class system for producing maps. Another group might have experts at
using maps to navigate, and yet another group might have discovered a computer vision
approach that works well for recognizing small objects in clutter.

2. Installation
2.1. Versions & Compatibility

As of Aug 2023, there is currently only one active version (more accurately called distribution)
of ROS to use - Noetic Ninjemys (Noetic in short). New ROS versions are released every May
depending on the release of new LTS (Long Term Support) versions of Ubuntu. The naming of
ROS distributions follows a convention similar to that of Ubuntu as seen in Week 01 - an
adjective followed by a turtle species name with the same first letter, in alphabetical order.

Fig. 7: ROS Noetic Ninjemys

ROS Noetic is suited to work with Ubuntu 20.04 (Focal) and shares the same End of Life
(EOL) date - May 2025. Some prominent older versions of ROS which have attained EOL are

Document prepared by: Adarsh Malapaka (NITK EE Batch of 2020)


NATIONAL INSTITUTE OF TECHNOLOGY KARNATAKA
Surathkal, Mangalore - 575025
EE430: Robot Dynamics and Control Laboratory
Department of Electrical and Electronics Engineering,
July - November, 2023

Kinetic Kame (Kinetic in short, suited for Ubuntu 16.04) and Melodic Morenia (Melodic in
short, suited for Ubuntu 18.04). No wonder why ROS is referred to as the Linux of Robotics
(still a better love story than Twilight!).

NOTE: ROS Noetic is the final release of ROS1 by Open Robotics. Future ROS releases will be
based on ROS2 only! This is why there is no active ROS distribution that corresponds to
Ubuntu 22.04 (the latest Ubuntu LTS version). In turn, this is why you were asked to install
Ubuntu 20.04 and not 22.04!

Until 2 years ago, ROS was available for Windows (and other OSs till date) on an experimental
basis. Mid 2019, Microsoft announced a general availability of ROS for Windows 10, refer to
the following if you’re interested.

● https://microsoft.github.io/Win-RoS-Landing-Page/#
● http://wiki.ros.org/Installation/Windows

2.2. Steps to Install

IMPORTANT:

● Please read through the remainder of the document in entirety first and then attempt
to follow the installation steps.
● If you encounter any errors during any of the below, please take a SCREENSHOT of the
Terminal clearly showing the Error received and the command you executed and send
it on the WhatsApp group.
● In the below section, anything that appears after “$” is to be typed in the Terminal
followed by pressing “Enter”.
● All of the below steps can be replaced by a single-line installation command. Here
(https://youtu.be/IqrpSi2Xueg) is a tutorial video for the same. All the intermediate
commands have been listed below in an effort to explain what’s going on at each step.

Step 01:

Go to Software & Updates and ensure the ‘universe’, ‘restricted’ and ‘multiverse’ options are
checked under Ubuntu Software -> Downloadable from the Internet as shown below. Click
Close; if it asks whether you'd like to update the list of repositories, click Reload.

Document prepared by: Adarsh Malapaka (NITK EE Batch of 2020)


NATIONAL INSTITUTE OF TECHNOLOGY KARNATAKA
Surathkal, Mangalore - 575025
EE430: Robot Dynamics and Control Laboratory
Department of Electrical and Electronics Engineering,
July - November, 2023

Fig. 8: Softwares & Updates

Step 02:

Open a new Terminal window using Ctrl+Alt+T. Type the following and press Enter, type your
password if prompted. This is to set up your computer to accept software from
packages.ros.org.

$ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc)


main" > /etc/apt/sources.list.d/ros-latest.list'

Step 03:

Set up your ‘keys’ that allow ROS to install software. First, install curl if it isn’t already
installed.

$ sudo apt install curl

$ curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc |
sudo apt-key add -

Step 04:

The following command is to make sure your Debian software packages are up to date.

$ sudo apt update

Document prepared by: Adarsh Malapaka (NITK EE Batch of 2020)


NATIONAL INSTITUTE OF TECHNOLOGY KARNATAKA
Surathkal, Mangalore - 575025
EE430: Robot Dynamics and Control Laboratory
Department of Electrical and Electronics Engineering,
July - November, 2023

Step 05:

To install all ROS packages, tools and libraries, use the following command. This is
recommended. You could install a specific ROS package alone as well, refer to Sec 1.4 in this
link (http://wiki.ros.org/Installation/Ubuntu).

$ sudo apt install ros-noetic-desktop-full

This step may take a while to complete. When prompted ‘Do you want to continue? [Y/n]’,
type ‘y’ or ‘Y’ and press Enter.

Step 06:

ROS expects certain environment variables. Rather than set their values every time you want
to use ROS, it is convenient to have them set automatically every time you open a new
Terminal window. Execute the following commands one after the other. This adds source
/opt/ros/noetic/setup.bash into the .bashrc file located in your HOME directory.

$ echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc

$ source ~/.bashrc

Fig. 8: HOME directory and .bashrc file

Document prepared by: Adarsh Malapaka (NITK EE Batch of 2020)


NATIONAL INSTITUTE OF TECHNOLOGY KARNATAKA
Surathkal, Mangalore - 575025
EE430: Robot Dynamics and Control Laboratory
Department of Electrical and Electronics Engineering,
July - November, 2023

Step 07:

Up to now you have installed what you need to run the core ROS packages. To create and
manage your own ROS workspaces, there are various tools and requirements that are
distributed separately, for ex: rosinstall, rosdep, etc. To install this and other dependencies for
building ROS packages, run:

$ sudo apt install python3-rosdep python3-rosinstall


python3-rosinstall-generator python3-wstool build-essential

Step 08:

rosdep enables you to easily install system dependencies for source you want to compile and
is required to run some core components in ROS. To install rosdep:

$ sudo apt install python3-rosdep

To initialize rosdep:

$ sudo rosdep init

$ rosdep update

Here is a video link (https://www.youtube.com/watch?v=ZA7u2XPmnlo) of the installation


process for reference. If you haven’t encountered any errors until now, you have now
successfully installed ROS on your machine! Next week, we shall set up our ROS workspace
and learn more about packages.

2. Additional Resources
Here (https://drive.google.com/drive/folders/1OtZP3VLMRjHCsxxMOl0JEqDyr0lI-cv7), is a
previously made drive folder of all the ROS reference books come across so far. Feel free to
read these books. If you find more useful resources, do send them in and they will be added
to this hopefully non-exhaustive compilation of books!

A word of caution, most of these books were written for older versions of ROS (such as Indigo,
Lunar, Hydro and Groovy) and so there might be slight discrepancies in the commands to be
used and certain functionalities.

Document prepared by: Adarsh Malapaka (NITK EE Batch of 2020)


NATIONAL INSTITUTE OF TECHNOLOGY KARNATAKA
Surathkal, Mangalore - 575025
EE430: Robot Dynamics and Control Laboratory
Department of Electrical and Electronics Engineering,
July - November, 2023

Below are a couple of links of various ROS projects and/or applications. Recognising the
growing importance for ROS in industrial robots, specifically of those in factory automation,
the ROS-Industrial open source project (Link #6 below) came into existence providing the
same features of ROS but directed for industrial robots.

I. https://robots.ros.org/
II. https://www.ros.org/news/2014/09/ros-running-on-iss.html
III. https://github.com/vmayoral/ros-robotics-companies
IV. https://vimeo.com/245826128
V. https://www.openrobotics.org/blog/2018/7/18/taking-ros-and-gazebo-into-healthcar
e
VI. https://rosindustrial.org/

NOTE: Week 01 and Week 02 pdfs are very long and verbose, apologies for the inconvenience
if any! In the subsequent weeks, information shall be compiled into PPTs in a concise manner
with more emphasis on imparting information during lab sessions.

Feel free to send your queries or discuss new ideas on the Whatsapp group!

Happy Learning!

Document prepared by: Adarsh Malapaka (NITK EE Batch of 2020)

You might also like