Download ROS - Thamaralins/unity_simulation_workshop GitHub Wiki

Installing ROS

This tutorial will guide you through the process of installing ROS2 on the Linux operating system (Ubuntu 22). ROS (Robot Operating System) is an open source framework that helps developers build and reuse code across robotic applications.

Step 1: Install Setup Sources

  1. Open a terminal window.
  2. Make sure the Ubuntu Universe repository is enabled.
    $ sudo apt install software-properties-common
    $ sudo add-apt-repository universe
    
  3. Now add the ROS 2 GPG key.
    $ sudo apt update && sudo apt install curl -y
    $ sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
    
  4. Add the repository to your sources list.
    $ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
    

Step 2: Install ROS2 Packages

  1. Upate and Upgrade the repository caches after configuring the respository.
    $ sudo apt update && sudo apt upgrade
    
  2. Desktop Install ROS2 Humble.
    $ sudo apt install ros-humble-desktop
    

Step 3: Installation Confirmation

After the installation is complete, you can perform the following test to verify that everything is proceeding as expected.

  1. Open a terminal window.
  2. Source the setup file.
    $ source /opt/ros/humble/setup.bash
    
  3. After then run a C++ talker.
    $ ros2 run demo_nodes_cpp talker
    
  4. Open a new terminal window.
  5. Source the setup file.
    $ source /opt/ros/humble/setup.bash
    
  6. After then run a Python listener.
    $ ros2 run demo_nodes_py listener
    

Screenshot from 2023-11-30 12-39-09

After completing the process mentioned above, you should see the speaker announcing the publication of messages and the listener confirming receipt of these messages. This is to verify the correct functionality of the APIs in C++ and Python.

Congratulations! You have successfully installed ROS2 Humble on Linux operating system.