Introduction to ROS

Posted: July 24, 2024

Hey there! Ever wondered how robots get their instructions on what tasks to perform? That’s where ROS, or the Robot Operating System, comes into play.

An image from Notion

What is ROS? 🤷‍♂️

The Robot Operating System (ROS) is a set of software libraries and tools that help you build robot applications. It’s a open source ecosystem consisting from drivers to state-of-the-art algorithms. ROS has everything to build a successful robotics devices, by being the fabricator for hardware and software integration.

Though it’s called an operating system, it functions more like middleware, providing services designed for a heterogeneous computer cluster such as hardware abstraction, low-level device control, implementation of commonly-used functionality, message-passing between processes, and package management.

Why ROS? 🤔

Imagine trying to build a robot from scratch. You’d need to handle everything from how the robot moves to how it processes sensory information. ROS makes these tasks easier by providing ready-to-use code and tools. It’s like having a toolbox that helps you build not just any robot, but smart robots that can do complex jobs.

Features of ROS 🔥

Here’s what makes ROS special in the world of robotics:

Simplified Working Structure of ROS 😎

While there are many simple and complex structures describing ROS workflow, here’s a simple representation. Tadaaa !

An image from Notion

A simplified ROS flow diagram

Confusing? Let me clear it out for you.

Here’s how it works in ROS:

  • Publisher Node: A node that sends messages. It creates a topic and broadcasts messages on that topic. These messages can contain various types of data, such as sensor readings or status information.
  • Modularity: This is one of the coolest parts of ROS. You can plug in different modules or packages as needed. For example, if someone else has figured out a good way to make a robot avoid obstacles, you can use that module in your project instead of starting from scratch.
  • Powerful Tools: ROS comes with some awesome tools that help you visualize what the robot is thinking and simulate its behavior in a virtual environment before you ever build it physically. Tools like Rviz for 3D visualization and Gazebo for simulation are game-changers.
  • Community and Ecosystem: ROS has a huge community of developers and researchers who contribute packages and tools, making it easier for everyone to find solutions to common robotic problems.
  • Subscriber Node: A node that receives messages. It subscribes to a topic and listens for messages broadcasted by publishers. Upon receiving a message, it can perform actions based on the data received.

What is ROS Master then ? 🤯

The ROS Master provides naming and registration services to the rest of the nodes in the ROS network. This means that it keeps track of all publishers and subscribers and helps them establish connections with each other. Without the ROS Master, nodes wouldn’t know where to send or receive their messages.

Key Functions of the ROS Master:

  • Registration: Nodes report their existence to the ROS Master, along with the topics they publish or subscribe to.
  • Lookup: When a node needs to find others that publish or subscribe to a specific topic, it asks the ROS Master for this information.
  • Establishing Connections: The ROS Master tells nodes about each other, but it does not handle the actual data transmission. Once nodes know about each other (through the Master), they establish direct connections to exchange messages.

How ROS Master Works:

  • Initialization: The ROS Master is started before any other ROS nodes. It runs as a separate process, typically initiated at the beginning of a ROS session.
  • Node Registration: When a new node starts, it registers with the ROS Master, telling the Master what messages it will publish and what messages it wants to subscribe to.
  • Topic Management: The Master keeps a list of topics and which nodes are publishing or subscribing to each topic.
  • Service Registration: Nodes can also provide services, which are a form of synchronous communication in ROS. Nodes offering services register these with the Master as well.
  • Parameter Server: The ROS Master also hosts a parameter server where key-value pairs can be stored and accessed by any node in the ROS network. This is useful for sharing configuration parameters that might be needed by multiple nodes.

Real-life Examples for ROS 🤖

Here are some real life scenarios where ROS is promienetly used:

An image from Notion

That’s it for this post, let’s get to know ROS a little bit more in depth in the next blog! 😄

  1. Autonomous Vehicles : ROS is extensively used in the development of autonomous vehicles. These vehicles use ROS for handling tasks such as perception, decision-making, and navigation. Companies like Tesla and Waymo use technologies similar to ROS for their autonomous driving solutions.
  2. Industrial Automation : In industrial settings, ROS is used to manage and control robots that perform tasks such as assembling, painting, and welding. It’s particularly popular in automotive manufacturing.
  3. Healthcare and Surgery: ROS is also making strides in the healthcare sector, particularly in robotic surgery and assistance. Robots equipped with ROS can perform complex surgeries with high precision or assist physically challenged individuals.
  4. Space Exploration: ROS is used in space to control robotic arms and rovers. It helps in tasks such as repairs, scientific research, and exploration on other planets.
  5. Education and Research: Educational institutions use ROS to teach students about robotics and conduct research. It provides a practical framework to learn about robotics programming and interaction.