Overview
The iRobot Create3 ROS2 navigation and SLAM examples imply watching/controlling of the mobile platform via Rviz running on a separate host.
The Rviz software stands for “3D robot visualizer” which is a part of ROS2 distribution. It provides a GUI with a set of tools to visualize and control the robot using the ROS2 communication protocols.
This application note provides steps needed to setup a Linux host for that purpose.
NOTE: ROS2 does not provide out-of box support for installation on Windows machines. For those who interested in compiling ROS2 distribution for Windows 10 can look into https://docs.ros.org/en/humble/Installation/Alternatives/Windows-Development-Setup.html for instructions.
Install Ubuntu 22
Proceed with https://ubuntu.com/download/desktop for downloading link and installing instructions. Make sure you download and install 22.04 LTS version.
If you are not sure which Ubuntu version your Linux desktop runs, start Terminal application and use the following shell command:
cat /etc/os-release
Output:
PRETTY_NAME="Ubuntu 22.04.1 LTS" NAME="Ubuntu" VERSION_ID="22.04" VERSION="22.04.1 LTS (Jammy Jellyfish)" VERSION_CODENAME=jammy ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" UBUNTU_CODENAME=jammy
Configure bash as the System-Wide Shell
Rviz relies on the bash-type shell scripts that don’t work with the default Ubuntu shell dash
. Run the commands below to set up bash
as the system shell:
sudo dpkg-reconfigure dash
(Say No
to the Use dash as the default system shell (/bin/sh)?
question.)
Install chrony Time Service
For the precise time synchronization between the robot and the host we need the chrony
package:
sudo apt install chrony
Configure ROS2 APT Repositories
Start Terminal application.
Set UTF-8 locale:
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
Output:
LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL=
Enable Ubuntu Universe repository:
sudo apt install software-properties-common sudo add-apt-repository universe
Download and install ROS2 GPG key:
sudo apt update && sudo apt install curl -y sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /etc/apt/trusted.gpg.d/ros-archive-keyring.gpg
Add the ROS2 repository to your sources list:
echo "deb http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
Update
apt
cache:sudo apt update
Install ROS2 Packages
Proceed typing commands in the Terminal application:
Install the Rviz application:
sudo apt install ros-humble-rviz2
Install
cyclonedds
RMW:sudo apt install ros-humble-rmw-cyclonedds-cpp
Install a common CLI command extension:
sudo apt install ros-humble-ros2cli-common-extensions
Configure VoxeBotics APT Repository
Proceed typing commands in the Terminal application:
Add VoxelBotics repository to the apt sources:
echo "deb [trusted=yes] https://vb-files.fra1.digitaloceanspaces.com/debian/ jammy voxelbotics" | sudo tee /etc/apt/sources.list.d/vb.list > /dev/null
Update apt cache:
sudo apt update
Install Package with SLAM Demo Rviz Configuration
Proceed typing command in the Terminal application:
sudo apt install ros-humble-create3-slam-launch
Test Rviz
Open the Terminal application.
Run Rviz in 3D mode:
/opt/ros/humble/share/create3_slam_launch/scripts/start_rviz
Close Rviz.
Run Rviz in flat mode:
/opt/ros/humble/share/create3_slam_launch/scripts/start_rviz -flat
Close Rviz.
Close the Terminal application.
What’s next
Proceed to Launching SLAM for launching LIDAR-only navigation, or proceed to PMD Flexx2 SLAM Setup to setup PMD Flexx2 camera for enhanced object avoidance.
Related Topics
Introduction to ROS2 Navigation and SLAM quick introduction to the ROS2 navigation concepts.
iRobot Create3 SLAM Setup application note for preparing iRobot Create3 for ROS2 navigation and SLAM.
PMD Flexx2 SLAM Setup application note form mounting the PMD ToF camera.
Launching SLAM application note on launching ROS2 navigation on iRobot Create3.