September 3, 2015

Introduction to ROS

ROS is a Robot Operating System. ROS is an open source platform and a Meta- operating system that can be used for your robots and gives a flexible environment to work. ROS focuses on the reusability of the code and makes different sections which can communicate in between themselves to simplify the process and it gives a well-defined system which can be accessed from multiple systems. ROS framework can be easily implemented with any modern programming languages like C++, lisp, python etc

WHY ROS IS REQUIRED:

We usually don’t work with2-3 programs simultaneously. And even if we are coding for our system consisting of different sections like sensor circuitry, motor driver circuitry etc, concurrency, inter- communication and extensibility, these are the things that we don’t usually do. You will find it difficult to use raw APIs (Application Program Interface, they are protocols, routines and tools for creating software applications) which are used in programming for GUI(Graphical User Interface). But ROS makes all this simple

Without changing the complete grammar and vocabulary of the programming, we can build our system based on the basic platform available that is why ROS is called as a meta operating system(meta operating system is a OS that is built on a main OS and allows different processes to communicate with each other at runtime) in case of ROS it is based on Ubuntu-Linux.

ROS provides following features:

  1. Abstraction of Hardware
  2. Device control at low level
  3. Implementing generally used functionality
  4. Exchange of messages between different processes
  5. Managing packages
  6. Tools and libraries are available for obtaining, creating, writing and running codes using multiple computer systems or androids etc.
  7. Peer to peer topology (in which both the sections or programs included can be client or server having same importance).

ROS Architecture:

ROS has few important terminologies as follows:

  1. NODES:

    Nodes are the processes that perform computation just like our normal programs or codes. And they communicate among themselves under the frame of action of ROS. These nodes are registered and work under the guidance of a ROS master(only one ROS master can run at a time). We can have several nodes for performing different tasks like taking sensor’s data, driving the motors, locating itself in the surrounding with the camera, processing the pictures, mapping the surrounding, processing the overall data etc.

  2. TOPIC:

    Nodes communicate with each other over a topic. Consider nodes as senders and receivers of mails then topic becomes the post office where the mails are dumped and the nodes who need these mails can receive from there. When the nodes are working independently and giving the output of their processes, they need to communicate for sending the result for further processing, so for this purpose ROS uses topics. A node can publish the data to the topic or subscribe the topic for receiving the data given by other nodes.
    A node can subscribe to any number of topics. This is how the communication is established

  3. Communication as messaging:

    The mails that we are referring to are nothing but the messages. Communication becomes easier when same kinds of messages are sent to a specific message topic so that ROS can convert these messages i. e. datastructures into bytes streams at the sender’s end and can transmit to recipient’s end. Again it is converting the bytes back to the messages of the same datastructures. So it’s like every node has its own message topic or just a topic where it is dumping all its data.

  4. Publisher and subscriber:

    To get some data the node has to ask the other node for the data i.e. subscribing. The node must have an instance of object that is called a ROS subscriber. When any node outputs its data to a topic, it needs to have one more object i.e. ROS Publisher. Publisher publishes the data over the ROS topic and subscriber subscribes to the topic for getting the data.

  5. Services:

    Sending and receiving the messages is a continuous phenomenon. ROS provides with one more facility of contacting the nodes in the network known as services. Services allow the node to send the request and receive the response. Note that the request is send to that message topic to which the other node is publishing. With ROS services, calling the function in another node is as easy as calling a local function. Services communicate with a name and we have several commands those can be used on topics as follows
    rosservice list
    rosservice call
    rosservice type
    rosservice find
    rosservice uri

Following image shows the overall processing going on

ROS Computer1,png


Let’s consider one example if you have camera fixed on your robot and you want to see all the images on your laptop as well as on the laptop attached with the robot then the overall process happening is depicted in the image below
ROS Computer on Robot Laptop


In the following image you can see the application of services in ROS
ROS Computer on Robot


  1. Packages:

    ROS is organized in different packages which contain codes, build files, launch files, manifests, services, a ROS-independent library, a dataset, configuration files etc. The purpose of the packages is to make the ROS functionality in easy to consume way

  2. Stacks

    Some similar kinds of packages are bound together known as stacks. A collection of packages for distribution.




References:
https://support.clearpathrobotics.com/hc/en-us/categories/200165835-ROS
https://github.com/uscrs-art/uscrs-art/wiki/ROS-Tutorial-4.-ROS-Overview%3a-Nodes,-Messages-and-Services
http://in.mathworks.com/hardware-support/robot-operating-system.html
http://robohub.org/ros-101-intro-to-the-robot-operating-system/
http://students.iitk.ac.in/roboclub/old/data/tutorials/Lectures/ROS.pdf
http://www.jitrc.com/downloads/ppt_reports/ROS_tut_jit.pdf
http://stackoverflow.com/questions/15150599/what-is-the-deference-between-operating-system-and-meta-operating-system

Note:For installation of latest version of ROS and detail information for starting with ROS refer to ROS’s official website.

Leave a Reply

Your email address will not be published. Required fields are marked *