ROS Introduction

##ros ##ros2 ##robotics ##robotoperatingsystem

Aasish KC May 27 2021 · 2 min read
Share this

Robot Operating System

Robot operating system is a meta operating system that is built on top of Ubuntu (Linux). It provides all kinds of services which we expect from an operating system. It also provides tools and libraries for obtaining, building, writing, and running code across multiple computers. Its usefulness is not limited to robots, but the majority of tools provided are focused on working with peripheral hardware. ROS is split up into more than 2000 packages, each package providing specialized functionality. The number of tools connected to the framework is probably its biggest power.

Benefits of using ROS

ROS provides functionality for hardware abstraction, device drivers, communication between processes over multiple machines, tools for testing and visualization, and much more.

The key feature of ROS is the way the software is run and the way it communicates, allowing you to design complex software without knowing how certain hardware works. ROS provides a way to connect a network of processes (nodes) with a central hub. Nodes can be run on multiple devices, and they connect to that hub in various ways.

The main ways of creating the network are providing requestable services, or defining publisher/subscriber connections with other nodes. Both methods communicate via specified message types. Some types are provided by the core packages, but message types can be defined by individual packages.

Developers can assemble a complex system by connecting existing solutions to small problems. The way the system is implemented, it allows us to:

  • Replace components with similar interfaces on the fly, removing the need of stopping the system for various changes
  • Multiplexing outputs of multiple components into one input for another component, allowing parallel solving of various problems
  • Connect components made in various programming languages by just implementing the proper connectors to the messaging system, making it easy to develop software by connecting existing modules from various developers
  • Create nodes over a network of devices, without worrying about where code is run and implementing Interprocess communication (IPC) and Remote Procedure Call (RPC) systems
  • Directly connect to feeds on demand from remote hardware without writing any extra code, by employing the previous two bullet points
  • ROS has multi-platform support and allows connections between processes over multiple devices via peer-to-peer connections that are handled behind the scene. The design allows support for any language by wrapping the C++ communication classes or manually developing classes for the language interface. ROS is made by its own community, meant for its community. After several years, that resulted in a great number of reusable packages that are simple to integrate, thanks to the architecture of the system.

    ROS Installation

    STEP 1: Setup your computer to accept software from

    • sudo sh -c 'echo "deb $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

    STEP 2: Setup your keys

    • sudo apt-key adv --keyserver 'hkp://' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

    STEP 3: Installation

    Update your packages before proceeding

    • sudo apt update

    Desktop-Full Install: (Recommended): Everything in Desktop plus 2D/3D simulators and 2D/3D perception packages

    sudo apt install ros-noetic-desktop-full

    Desktop Install: Everything in ROS-Base plus tools like rqt and rviz

    sudo apt install ros-noetic-desktop

    ROS-Base: (Bare Bones) ROS packaging, build, and communication libraries. No GUI tools.

    sudo apt install ros-noetic-ros-base

    STEP 4: Environment Setup

    source /opt/ros/noetic/setup.bash

    You have to source this script every time you open a new terminal. For convenience to automatically source this script every time a new shell is launched. These commands will do that for you.

    Now you are done with the ROS installation part. Stay tuned for further updates on ROS

    Read next