Skip to content

1. Understanding ROS

Hamsadatta edited this page Mar 8, 2020 · 1 revision

Intro

Ever wondered how a robot works or how a robotic software is written? What are the software tools required to build a robot? Well, this article attempts to answer all the questions. Robotics is a multidisciplinary field with a blend of software, hardware, mechanical structure, and motion, in early days people did not have a standard software that would plugin into their hardware so, people had to reinvent the wheel again and again while building a new robotic software with little emphasis on open source software collaboration, moreover, people writing the software had little knowledge on the hardware. These were the founding pillars of the Robot Operating System or “ROS”, it's an open-source adaptable framework for programming robots. It is an accumulation of tools, libraries, and packages that are useful to realize any robotic application. This article will talk more about the Robot Operating System.

ROS equation (source:ROS wiki) ROS equation (source: ROS wiki)

History

It all began at Stanford University’s Artificial Intelligence Laboratory in 2007, where few researchers were developing software for their personal robotics program or the PR1 (humanoid) robot. They were successful in creating the first baseline version of ROS. The development of ROS took pace when Willow Garage, a technology incubator started maintaining the software. This is when ROS went through a major paradigm shift in its development process by achieving many milestones and yearly releases. Currently, the Open Source Robotic Foundation (ORSF) is the maintainer of ROS.

Robot Platforms

ROS supports different robot platforms like wheeled robots, legged robots, drones, arm based robots, personal robots, etc. ROS can fit into any robot that runs on UNIX based operating systems.

Different robot platforms

ROS features

It is difficult to explain all the components of ROS, but we can discuss some interesting ones like ROS communication infrastructure, robot specific features, and tools with an example. Let us assume building a robot from scratch. The first thing is to design the robot, followed by embedding the required functionalities. Lastly, using suitable software and hardware components to realize the required functionality. Before we do that, we should perform simulations and analyze the feasibility of the required functionalities. Here ROS comes handy. It has robot specific features like parsing a custom-made URDF(Unified Robot Description Format) resembling the real robot including sensors, joints, and chassis which could be made in SolidWorks or any other CAD software, followed by assigning transforms and the common frame of references by using Robot Geometry Library. Further to provide the required functionalities to the robot, we need to understand the basics of how ROS internally works. Let us start with the architecture.

Custom Robot Model

Architecture

ROS is not an actual operating system, but it is a distributed framework of processes. These processes are realized using nodes. Nodes publish and subscribe to ROS topics and communicate with the help of the ROS Master. Topics are named buses, over which nodes exchange messages. There can be multiple publishers and subscribers to a topic. Interestingly, the code written for the nodes is language independent and ROS supports Python, C++, Lisp, etc. ROS is based on message passing architecture. The data is communicated between nodes via a message-passing system. The message passing system saves you time by managing the details of communication between various distributed nodes via the anonymous publish/subscribe mechanism. Currently, LINUX is a stable platform in which ROS runs reliably, a port for Windows and MAC is available but not with full functionality.

ROS Basic Architecture.

To organize code ROS uses packages, every package contains nodes in the form of launch files. ROS uses a catkin build system, as a method to build packages. ROS can also work in multiple machines. It means that one ROS node can communicate with another ROS node in completely independent systems, each with its own ROS system. In this way, plumbing is achieved in ROS. Now let us get back to our example. To simulate the model as per the real-world scenario, we build a life-like world with the help of a Gazebo simulator (open-source robotics 3D simulator) based on a physics engine. It can simulate the required dynamics and control for the robot. ROS integrates with Gazebo using ROS-Gazebo plugins. Just by adding the required plugins to the source scripts, we will be able to simulate the targeted functionality. Now to simulate the bot in the gazebo, ROS has packages like building a map, pose estimation, localization in a map, and even mobile navigation.

Pose estimation, Localization, and navigation in ROS.

A powerful feature of ROS is the incredible development toolset. ROS tools consist of command-line tools (CLI), GUI with Rqt (ROS GUI with Qt framework). There are about 45+ command-line tools available to help users for launching nodes, debug and playing back data. While using Rqt, Rviz is a useful GUI tool to visualize information (data coming from laser scanners, depth cameras, radars sensors, etc.).

Rviz User Interface.

Rqt graphical user interface. (source: James madison university)

RQt, on the other hand, is used for graphical interface development based on Qt-framework. It provides the freedom to the users to create custom user interfaces using existing libraries and Rqt-plugins. Within Rqt there are standard nodes like rqt_graph, rqt_plot, rqt_topic, etc. These nodes help to visualizes data, running nodes, and topics in a more organized manner. This is how we utilize the tools and capabilities of ROS.

Additional Libraries

Till now we have discussed internal tools of ROS, let us see ROS integration with some other libraries.

Integration with other libraries.

OpenCV: Is a profound computer vision library used by users around the world. ROS integrates with OpenCV by providing libraries such as image_pipeline which is used for camera calibration, monocular image processing, stereo image processing, and depth image processing. These libraries save a lot of time and make life easier.

MoveIt: If your project is dependent on motion planning, then MoveIt is a well-tested library which you can integrate into your robot. ROS gives support ranging from wheeled platforms to legged humanoids with MoveIt.

Point cloud Library: PCL is an open-source 3D geometry processing library which deals with three-dimensional computer vision. This library is particularly useful when users are working with 3D cameras like Microsoft Kinect, Intel real sense, etc.

How to get started?

By this time, you should have a good idea about ROS, its capabilities, and all the tools required for your new robotic project. ROS helps you to bring your ideas into reality and that is the reason many people like robot hobbyists, researchers, and tech enthusiasts use it for rapid prototyping. Moreover, universities, as well as startups and big companies, have also started using it. But one question that remains is, how do you install ROS and learn the basics? To learn ROS, the first step would be going through the ROS Wiki page. The link for the same is given below.

Installation: http://wiki.ros.org/ROS/Installation (ROS Kinetic Kame recommended)

Tutorial and basics: http://wiki.ros.org/ROS/StartGuide

What is next?

In the next article, we will discuss more on creating a robot using URDF and ROS integration with Gazebo. We will learn things like adding Gazebo plugins for sensors for a differential drive robot as an example, so stay tuned. Meanwhile, readers can explore ROS and get a solid understanding of the ROS file system, catkin build, and try out a few examples from ROS wiki tutorials.