Skip to content

roboticaunip/Learning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

Environment Setup: Ubuntu 22.04 LTS & ROS 2 Humble

This guide documents the installation process of the Ubuntu 22.04 (Jammy Jellyfish) operating system and the configuration of the ROS 2 Humble Hawksbill robotics framework.

1. Operating System Installation

Before starting, define your installation method.

Note regarding Virtual Machines (VM)

You may choose to install Ubuntu on a Virtual Machine (using software like VirtualBox or VMware). This is a safe option for initial testing and does not affect your current operating system.

  • Pros: Easy to set up, no risk of losing Windows/Mac data.
  • Cons: Graphics performance (GPU) is significantly reduced, which may cause lag in ROS simulation tools (such as Gazebo and RViz).

Attention: This tutorial focuses on Native Installation (USB Boot) to ensure direct hardware access and maximum performance. If you choose to use a VM, install Ubuntu 22.04 on it and skip directly to Section 2.


Native Installation (Dual Boot or Dedicated)

Ensure you are running a clean and updated installation of Ubuntu 22.04 LTS.

Prerequisites

Critical Steps

  1. Boot via USB (BIOS/UEFI).
  2. Select the standard installation.
  3. Important: Check the option "Install third-party software for graphics and Wi-Fi hardware" during installation to ensure proprietary drivers (NVIDIA, Wi-Fi, etc.) are installed.

After the first login, open the terminal and update the base system:

sudo apt update && sudo apt upgrade -y

2. ROS 2 Humble Installation

Following the official documentation and system requirements.

2.1 Locale Configuration (UTF-8)

ROS 2 requires an environment with UTF-8 support.

Execute the commands below to ensure the correct configuration:

sudo apt update && sudo apt install locales
sudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8

Verify the settings with the command: locale

2.2 Adding Repositories (Sources)

It is necessary to enable the Ubuntu Universe repository and add the ROS 2 GPG key.

  1. Enable Universe:

    sudo apt install software-properties-common
    sudo add-apt-repository universe
  2. Add GPG Key and Repository:

    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
    
    echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null

2.3 Package Installation

Warning: Due to recent updates in Ubuntu 22.04 (systemd/udev), it is crucial to run the upgrade command before installing ROS packages to avoid dependency conflicts.

  1. Update repository cache:

    sudo apt update
    sudo apt upgrade
  2. Desktop Version Installation (Recommended): Includes ROS, RViz, demos, and tutorials.

    sudo apt install ros-humble-desktop
  3. Development Tools: Required to build packages later (Colcon).

    sudo apt install ros-dev-tools

3. Environment Configuration (Sourcing)

For the terminal to recognize ROS commands, the setup script must be loaded.

Run this in every new terminal:

source /opt/ros/humble/setup.bash

Automation (Optional): To add this to your .bashrc and automatically load it in every new terminal session:

echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
source ~/.bashrc

#4. Installation Verification (Talker/Listener Demo)

To validate communication between Nodes, we will use the C++ (Talker) and Python (Listener) examples.

  1. Terminal 1 (Talker):

    source /opt/ros/humble/setup.bash
    ros2 run demo_nodes_cpp talker
  2. Terminal 2 (Listener):

    source /opt/ros/humble/setup.bash
    ros2 run demo_nodes_py listener

If the Listener receives the "Hello World" messages from the Talker, the installation was successful.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published