Robot Operating System

Introduction to ROS: The Backbone of Modern Robotics

Robots are complex systems composed of various hardware components like sensors, motors, cameras, power systems, and more. To make all these heterogeneous components work together as a single coordinated unit, we need robust software that can manage, control, and integrate these devices seamlessly. This is where ROSβ€”Robot Operating Systemβ€”comes into play.

Despite its name, ROS is not a true operating system. Instead, it is a middleware framework that facilitates the development of robotic software. It abstracts the complexities of hardware integration and provides developers with tools and libraries for building robust, scalable, and reusable robotic systems.

Why Use ROS?

  • Hardware abstraction to integrate different devices.
  • Message-passing communication to let software components exchange data.
  • A vast collection of open-source libraries for perception, planning, control, and manipulation.
  • Tools like Gazebo and RViz for simulation and visualization.

ROS supports both research and industrial applications and has a strong developer community that contributes to its continuously evolving ecosystem.

Key Tools and Libraries

  • 1. Gazebo: A powerful 3D simulator for testing robot models with accurate physics and environment modeling.
  • 2. RViz: A visualization tool for sensor data, robot states, planned paths, and maps.
  • 3. MoveIt: A flexible motion planning framework for robotic arms, supporting kinematics and trajectory planning.
  • 4. Navigation2 (Nav2): The ROS 2 navigation stack, handling mapping, localization, planning, and obstacle avoidance.
  • 5. ros_control: A standard interface for robot hardware control, managing actuators and controllers.

ROS Versions: ROS 1 vs ROS 2

ROS 1

  • Established and mature.
  • Large user base and extensive package availability.
  • Single-threaded by default; less suitable for real-time or safety-critical applications.

ROS 2

  • Designed to overcome ROS 1 limitations.
  • Built on top of DDS (Data Distribution Service) for real-time distributed communication.
  • Supports multi-platform, real-time, and secure applications.
  • Active development and strong community support.

Version Types

  • LTS (Long-Term Support): Stable versions that receive long-term updates (e.g., ROS 2 Humble).
  • EOL (End-of-Life): Versions that are no longer maintained or updated.

ROS 2 Architecture: Core Concepts

  • Nodes: Independent processes that execute specific tasks, like camera drivers or control systems.
  • Topics: Publish/Subscribe communication channels used for data exchange between nodes.
  • Services: Synchronous communication for request-response interactions between nodes.
  • Actions: Asynchronous communication with feedback for long-duration tasks.
  • Parameters: Configurable runtime values that influence node behavior.
  • ROS Packages: Directory structures containing code, configuration, and metadata for modular ROS applications.

System Requirements

ROS is primarily supported on Linux, especially Ubuntu. While ROS 2 also offers partial support for Windows and macOS, Linux remains the most reliable and widely used platform for ROS development.

ROS Architecture Explained Using a Company Analogy

🏒 ROS = Company Management System

Just like a large company needs coordinated communication among departments to function smoothly, a robot uses ROS to coordinate its components.

πŸ”Ή Nodes = Departments

  • πŸ–₯️ Vision Department (Camera Node): Captures and processes images.
  • 🦿 Actuation Department (Motor Node): Controls wheels and joints.
  • 🧭 Navigation Department (Planner Node): Finds paths and avoids obstacles.
  • πŸ› οΈ Control Department (PID Node): Ensures actions are smooth and accurate.
  • πŸ“‘ Sensor Department (IMU/LiDAR Node): Measures environment and motion.

πŸ”Ή Topics = Inter-Department Memos

Nodes communicate via "topics", similar to sending memos between departments:

  • The Vision Node publishes images to a topic like /camera/image_raw.
  • The Navigation Node subscribes to it to decide movement.

πŸ”Ή Messages = The Memo Content

Messages contain the actual data: position, speed, sensor values β€” just like a memo contains subject, date, and instructions.

πŸ”Ή Services = Direct Emails with Replies

When one department needs a specific answer from another (like HR asking IT about system status), ROS uses services β€” a request-response interaction.

πŸ”Ή Actions = Long Projects with Updates

Actions are like assigning a long-term project to a team with periodic progress updates and a final report.

πŸ”Ή Parameters = HR Records / Settings

Global settings (e.g., max speed, sensor limits) are stored in a "parameter server" β€” like HR records accessible to all departments.

πŸ”Ή ROS Master / DDS = Internal Communication System

  • ROS 1: Uses ROS Master, like a company receptionist managing who talks to whom.
  • ROS 2: Uses DDS, like a modern digital messaging system where employees (nodes) connect directly.

βœ… Final Picture

Just as a company with well-defined roles and communication policies can function efficiently, a robot using ROS functions through coordinated nodes, topic-based communication, and reusable software modules. ROS turns robotic chaos into collaborative automation.

Comparison of ROS1 and ROS2

πŸ“· Add an Image

A related image about pointers or simulation

▢️ Embed a YouTube Video

πŸ“‘ Additional Section

Learn how pointers are used in plugin development, managing memory in ROS2 nodes, and other relevant applications.