ROS2 (Iron)

set of software libraries and tools that help you build robot applications

Installation instructions or continue here (same tutorial)

locale  # check for UTF-8

sudo apt update && sudo apt install locales # had to restart
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

locale  # verify settings
sudo apt install software-properties-common
sudo add-apt-repository universe
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 $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
sudo apt update && sudo apt install ros-dev-tools -y
sudo apt update && sudo apt upgrade -y
sudo apt install ros-iron-desktop -y

source /opt/ros/iron/setup.bash

In one terminal, source the setup file and then run a C++ talker:

source /opt/ros/iron/setup.bash
ros2 run demo_nodes_cpp talker

In another terminal source the setup file and then run a Python listener:

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

ROS2 version

cd /opt/ros
ls
#displays ROS2 version

Uninstall

sudo apt remove ~nros-iron-* && sudo apt autoremove

Last updated