ROS 101: A 10 Step Guide to Getting Started with ROS
If you are a budding roboticist who loves to play with robots or aspires to build a career in robotics, you might have come across the Robot Operating System (ROS). As the name suggests, this is an operating system that provides an agile development environment for distributed computing and deployment of various algorithms to accomplish tasks with robots. Though it is not “mandatory” to use ROS, given the active community among other features which will be discussed shortly, ROS has grown in popularity over the years.
As a beginner, the biggest challenge is the lack of structured blueprint to walk you through the step-by-step process to learning ROS, incrementally. While there are numerous videos, books and lectures, aside from the official ROS resources such as the ROS Wiki and ROS Tutorials there remains a need to provide an incremental roadmap which is where this article comes in.
So, with this ROS 101 guide, let us look into the step-by-step process to learning ROS for absolute beginners.
Table of Contents
- Key takeaways
Step-1: What is ROS?
ROS is a set of open source libraries and tools for building, deploying and running robotic applications. It has a massive community and can be used for a wide range of applications.
ROS enables software modularity, scalability and portability where the same codebase can be reused across robots, even platforms and even teams/research groups.
It provides a plethora of features, such as support for multiple hardware, intuitive monitoring tools, powerful libraries and support for multiple programming languages like C++/Python.
Step-2: Where is ROS used?
The best way to understand the potential of ROS is by looking at some of the applications where it is used:
Service robots like Fetch Robotics’ “Freight” which are used in warehouses to transport goods from one place to another.
Self-driving cars from companies like Tesla, Volvo, Audi, etc.
Domestic robots like Roomba from iRobot which are used for cleaning floors.
Space exploration robots like Curiosity Rover from NASA which explore other planets in our solar system.
The possibilities are endless, and with ROS you can build scalable and multi-utility robotic applications.
Step-3: Why should you use ROS?
ROS is a great choice for robot programming and automation due to the following reasons:
It is free, open source and has a large community of contributors, developers and users.
It provides a software platform that enables developers to quickly develop, simulate and test their algorithms.
It can be used on multiple hardware platforms and is scalable.
It allows you to use multiple programming languages, so you can choose the language you are most comfortable with.
It has powerful libraries that provide robust capabilities like 3D vision, motion planning, simulations, etc.
There is plenty of documentation, tutorials and a rich ecosystem of resources available to get started.
Having said this, it is essential to understand that using ROS is by no means mandatory. It just is preferred given the aforementioned utilities that come with it but there is always a possibility of developing custom APIs and interfaces for robots completely bypassing ROS should you choose so.
Step-4: Programming languages in ROS
ROS supports a wide range of programming languages such as C++, Python, Lua, Java and MATLAB. While most developers prefer to code in C++ because of its speed and flexibility, Python is becoming increasingly popular nowadays.
Step-5: Familiarize yourself with ROS architecture
If you decide to go with ROS, you should start familiarizing yourself with the ROS architecture and the jargon.
To help with this, I’ve put together a detailed yet intuitive guide called ROS 101: Hands-on Experience with ROS using Python that comes with worked examples.
The guide comes with numerous figures depicting real-life examples to help absolute beginners easily understand the various jargons and get comfortable with the overall ROS architecture.
Step-6: Pick between ROS or ROS2
If you aren’t aware of it, there now is a new version of ROS called ROS2.
While there may be an ongoing debate about whether it is “ROS2” or “ROS 2”, you should consider making up your mind about which of these versions you wish to use for your projects.
If for some reason you are unable to pick one, you need not worry as there is a ROS1 → ROS 2 bridge you can use to connect both versions of ROS.
Step-7: Setup ROS on your PC using Docker
When you look up the official documentation for installing ROS, you will be greeted with a set of commands to download and install ROS depending on your OS.
WARNING!! DO NOT TRY AND INSTALL ROS DIRECTLY ON YOUR OWN PC IF YOU EVER WANT TO SHARE YOUR CODE WITH OTHERS OR PERHAPS OPEN SOURCE IT. TRY DOCKER INSTEAD. EXPLAINATION BELOW.
Why use Docker with ROS?
Some of the ROS distros come with long term support (identifiable with the LTS suffix) and come with package managers. But, there is always a key issue when sharing your ROS codes: just because it works on your PC does not guarantee it works for others.
So, is there a better way to ensure cross device compatibility?
Turns out, the answer is to use Docker, which allows us to develop self-contained environments and manage multiple environments with ease.
What this means is that you now have a flexibility to develop multiple ROS projects (ROSjects for short) each with their own software specifications and making changes to one environment will no longer mess up the other ROSjects.
Here is a step-by-step tutorial on how to install Docker + ROS on your Windows 10 (or higher) PC.
Step-8: Create your 1st ROS project (ROSject)
Now is your chance to actually get your hands dirty and test out your understanding of the ROS concepts and the mechanics and dynamics of a robot platform.
What better way to do this than building your very own ROSject. For this, make a list containing the robot platform type and the sensors you want to test out. If you need help getting started, read the introductory guide on getting started with mobile robots.
Once you have the list ready, use the toy ROSjects from my tutorial as a starting point and get a basic example up and running.
Step-9: Connect with a real robot platform
If you are successfully able to build and execute a ROSject, it is now time to connect with a real robot platform via ROS and unleash the true potential of ROS.
For this, look around and see which robots you have access to. If you do not have access to commercial robot platforms, you can always use the budget friendly kits.
Depending on whether you go with a commercial robot or a kit, you would then have to lookup a corresponding tutorial to connect to ROS. Most commercial robots come with barebones github repositories with examples so be sure to check that out to make life easy.
To test if the connection was successful, simply launch a simulator in ROS such as RViz and connect to one of the on-board sensors. You should now be able to visualize the sensor data in the simulation which is a sanity check that you have control over the robot.
Step-10: Build a web-GUI for your robot
Add features to your GUI like buttons, display windows, text messages etc., and build an AI suite to make your robot autonomous.
Try making it do a real world task like going from point A to point B and be sure to document and enjoy the whole process.
ROS represents the future of robotics and automation and is an invaluable tool for developers, engineers and hobbyists alike. It provides a comprehensive software platform for developing and testing robotic applications, is open source and has a vibrant community. With its powerful libraries, multiple programming languages and documentation, anyone can start learning ROS and building cool robotic projects.
The challenge that most beginners face while learning ROS is the lack of a structured step-by-step to help them get started with ROS. This tutorial provides a set of steps and resources to help absolute beginners get up and running with ROS.
From getting comfortable with the ROS terminology to setting up ROS on your PC using Docker, the steps listed provide you with the right tools and resources to get comfortable with ROS. After going through those steps, you can move on to the fun part of building your own ROSjects with a real robot platform and building a web-GUI for your robot. Along the way, you can document your progress and share it with the ROS community and inspire others.