Setup Linux Host for Running Rviz

1. 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.

2. Install Ubuntu 22

Proceed with Download Ubuntu Desktop | Ubuntu 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

3. 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.)

4. Install chrony Time Service

For the precise time synchronization between the robot and the host we need the chrony package:

5. Configure ROS2 APT Repositories

  1. Start Terminal application.

  2. Set UTF-8 locale:

    Output:

  3. Enable Ubuntu Universe repository:

  4. Download and install ROS2 GPG key:

  5. Add the ROS2 repository to your sources list:

  6. Update apt cache:

6. Install ROS2 Packages

Proceed typing commands in the Terminal application:

  1. Install the Rviz application:

  2. Install cyclonedds RMW:

  3. Install a common CLI command extension:

7. Configure VoxeBotics APT Repository

Proceed typing commands in the Terminal application:

  1. Add VoxelBotics repository to the apt sources:

  2. Update apt cache:

8. Install Package with SLAM Demo Rviz Configuration

Proceed typing command in the Terminal application:

9. Test Rviz

  1. Open the Terminal application.

  2. Run Rviz in 3D mode:

  3. Close Rviz.

  4. Run Rviz in flat mode:

  5. Close Rviz.

  6. Close the Terminal application.

10. 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.

11. Related Topics