contact@blackcoffeerobotics.com
14, Raghava Enclave, Transport Road, Secunderabad, Hyderabad (500009)
©2024 All Rights Reserved by BlackCoffeeRobotics
If you are a robotics student, a researcher, a hobbyist or an engineer looking to develop applications ranging from a simple simulation to a full-blown fleet of autonomous robots, this post is for you. In this post, I’ll be providing an introduction to ROS (Robot Operating System), why you should use it, what it can do for your application and how you can proceed with your learning on this subject.
Almost 5 years ago when I started studying robotics, I came across ROS. I looked around the web, trying to get an understanding of what it is, where I can use it and why should I learn it. In my attempt to understand the technology, I stumbled across some more terms - middleware, hardware abstraction, message-passing and many more. I couldn’t make much of these terms at the time but went ahead to install ROS anyway. As an inexperienced developer in Linux system, I struggled some more and eventually gave up. I just stuck to what I knew, MATLAB.
If you are, like I once was, new to the development arena, I hope you make the best of this series of posts to help you start with developing robot applications. Before we begin, here is what 10 years of ROS looks like:
Let’s start with an example. For some reason, you have decided to build an autonomous mobile robot. You have realized you can get reliable yet economical motors from any of your favorite vendors. You have even managed to get an Arduino up and running to control your motors. Next, you have a 2D Lidar to localize and some obstacle sensors to prevent you from ramming into strangers. Finally, you just want to put all of them together on a Raspberry Pi. Here is what you would be doing without ROS:
All this, just to be in a position to use that data! On top of this, you’ll have to figure out what datatype your localization algorithm uses as inputs, diagnostic tools and so much more. Furthermore, your processes could be so intermingled that changing one sensor source could cause widespread chaos across your code-base. Lastly, anyone willing to reproduce your amazing motion planning code will have to use the exact same sensors, motors and controllers to get the code running. Needless to say, it only gets worse as the number of components increases and you move to more complicated applications. Fortunately, this is where ROS comes in.
Let’s continue the example we started with.
See how several components are connected to each other, often depending on each other for operation? ROS provides that transport layer to facilitate this communication. It allows the exchange of data using standard data-types (called ROS messages). In the picture, they are shown within square braces, don’t worry if you don’t understand specifically what each of them means. Just grasp the basic idea that it is essentially like “int”, “string” or “float” from your C++ programming days. In practice, several hardware manufacturers provide ROS drivers for their components which allows users to readily build applications using them. It helps the vendors because it opens up the product for a range of applications by developers across the globe, it helps the roboticists as they don’t have to write custom communication for each sensor they purchase. Win-Win!
Now let’s look back at the terms that once had me scared:
Neat. That’s the idea of ROS in a nutshell. Development in ROS provides several other advantages such as integrated libraries for applications, easy collaboration, a large support and development community, and several “out of the box” packages to setup your robot(s) in no time.
The first thing to do would be to get your hands dirty and install ROS. www.ros.org is the home of ROS, you can check it out regularly for any updates, just go through it once to get a hang of it. Follow the instructions (https://www.ros.org/blog/getting-started/) to install ROS. If you are on Ubuntu 16.0X, you should use ROS Kinetic, for Ubuntu 18.0X use ROS Melodic. If you are familiar with Docker containers, you can also use them to kick-start your ROS journey.
After installation, you need to setup your environment and workspace. At the end of this process, you should have a directory called catkin_ws in your file system. Do not worry if you don’t know what a workspace is, I’ll be covering it in the next article along with other key concepts such as packages, nodes, topics, publishers, subscribers, services and more. Stay tuned!
Thank you for reading this. Let me know in the comments if anything was too hard to grasp or needs more explanation. Feel free to drop any recommendations on topics you would want me to cover in the future.