Run ROS2 on joshua ubuntu

The Robot Operating System (ROS) is a powerful framework that provides a collection of tools and libraries for robotics research and development. Since its initial release, ROS has become the de facto standard in the field of robotics technology, widely used in a variety of projects across both academia and industry. ROS 2 is the next-generation version of ROS, bringing with it numerous improvements, including enhanced security, real-time performance, and support for multi-robot systems.

As technology continues to advance, ROS 2 is emerging as the platform of choice for developing complex robotic systems. Ubuntu, one of the most popular Linux distributions, is ideal for running ROS 2 due to its stability and extensive community support. Installing ROS 2 on Ubuntu is not only a fundamental skill for robotics experts and developers but also an excellent learning opportunity for anyone with an interest in robotics technology.

This article aims to provide a simple guide for readers to install ROS 2 on Ubuntu.

refer to https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html

Download and install the Joshua ubuntu

set locale

  • locale # check for UTF-8
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

locale  # verify settings

Setup Sources

  • enable Ubuntu Universe repository
sudo apt install software-properties-common
sudo add-apt-repository universe
  • get 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
  • add the repository to your sources
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

Install ROS2 packages

sudo apt update
sudo apt upgrade
sudo apt install ros-humble-desktop python3-argcomplete ros-dev-tools ros-humble-ros-base

source the config

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

try some examples

  • talker and listener

run the talker in one terminal

ros2 run demo_nodes_cpp talker

run the listener in another terminal

ros2 run demo_nodes_py listener
  • control the turtle

draw a turtle in one terminal

ros2 run turtlesim turtlesim_node

control the turtle in another terminal

ros2 run turtlesim turtle_teleop_key
2 Likes