DEV Community

Kai Tung Yu
Kai Tung Yu

Posted on • Originally published at Medium

How to Visualise and Control a ROS 2 Robot Remotely

Background

When I was learning ROS a few years ago, I tried to control a mobile robot running the Navigation Stack using RViz. At that time, I installed a remote desktop server on the computer running ROS. The installation was straightforward, but when I tried to launch RViz, it failed to start because 3D acceleration was required.

As a result, when developing LGDXRobot2, I explored different approaches to controlling the robot remotely. The use of RViz made tuning much easier, especially when working with Nav2 parameters. This article describes several ways to access RViz / robotics data remotely in order to control a robot.

1. Portable Monitor

RViz running on a portable monitor

The most straightforward way to run RViz remotely while allowing the robot to move freely is to connect a portable monitor directly to the robot’s computer and use a wireless mouse and keyboard.

Pros:

  • No software setup required

Cons:

  • Portable monitors can be expensive or have relatively small screens

2. PiKVM

The custom PiKVM hardware

Rviz running on PiKVM

PiKVM is a DIY IP-KVM solution for Raspberry Pi. It provides a web-based user interface for remote control. To build a PiKVM, I bought an HDMI-to-CSI bridge and a Raspberry Pi Zero 2 W (click here for instructions). This setup allows access to a remote desktop at up to 1080p resolution, including mouse and keyboard control for using RViz.

PiKVM has been used for the longest period during LGDXRobot2 development. However, the Raspberry Pi Zero 2 W has limited performance. When the robot moves far from the router, the remote desktop becomes very slow. In addition, the system may stop working due to overheating, it requires active cooling with an USB fan.

Pros:

  • Reasonable hardware cost
  • Resolution up to 1080p
  • Generally smooth display

Cons:

  • PiKVM requires additional configuration

3. Selkies

Rviz running on Selkies

Running Nav2 on Selkies

Selkies is a low-latency remote desktop streaming platform. Someone made a Docker image for it, I then extended the image by installing ROS 2 and the required dependencies. This resulted in the LGDXRobot2 Desktop image.

With Selkies, I can run ROS 2 on macOS or a remote robot and access RViz through a web browser. Also, the web interface is very responsive. As a result, this has become my primary method for developing LGDXRobot2 for a remote robot.

Pros:

  • No extra hardware required
  • Low latency
  • Supports high resolution (depending on the host)

Cons:

  • May impact the host computer’s performance
  • Requires Docker knowledge to configure a working environment
  • The Docker image is large (the LGDXRobot2 Desktop image is over 10 GB)

For this article, I also tested two additional methods for controlling a robot remotely.

4. Using RViz on a Second Computer

RViz is getting robotics data from remote computer

By default, ROS 2 distributes topic data using UDP multicast. Therefore, I can install ROS 2 on another computer and launch RViz. It can automatically discover topics from the remote robot.

After testing, I found the latency to be slightly higher than Selkies, but still acceptable. The robot model was not displayed because LGDXRobot2 ROS 2 was not installed on the machine.

Pros:

  • No extra hardware required
  • Low latency
  • Supports high resolution (depending on the host)
  • Straightforward setup

Cons:

  • None; installing the same software twice is not a significant issue

5. Foxglove

Screenshot of Foxglove

Foxglove is a visualisation and debugging tool for robotics data. It supports multiple operating systems and can also run in a web browser. The setup process is straightforward by following the official instructions.

Using Foxglove, I was able to view all topics from my robot, and the URDF model was displayed automatically. However, there was noticeable latency in the data stream. This may be due to incomplete configuration of the data streaming settings.

Pros:

  • No extra hardware required
  • Supports high resolution (depending on the host)
  • Straightforward setup
  • Configuration can be shared across a team

Cons:

  • Login is required to use the tool

Summary

Controlling a robot remotely does not mean sacrificing its freedom of movement. There are several ways to achieve this, even without buying additional hardware.

For LGDXRobot2, I will continue using Selkies, as the Docker image provides a ready-to-use ROS 2 environment for both physical robots and simulations. Although I have not spent much time testing Foxglove, it is a capable tool for remote robot control. In the future, I may provide a Docker image for LGDXRobot2 with the Foxglove ROS bridge pre-installed.

Top comments (0)