[Documentation] [TitleIndex] [WordIndex

CR 4: Programmatic control over RViz

Customers

Current state

Currently, the user interface of RViz is aimed at expert users and designed to be customizable and feature-rich. It is mostly used by the software developers themselves.

The user can add and remove displays, change their parameters, has full control over the camera and the window layout.

RViz can save its state into a config file, which includes the displays, their parameters and the camera settings.

Plugins allow the development of custom visualizations. Markers and Interactive Markers allow developers to display things inside the 3D view of RViz and let the user interact with them.

It is not currently possible to change an rviz viewpoint except by one of these methods:

Problem Description

If you want to develop a custom GUI for your application, you have to either start from scratch or provide a custom config file for RViz. An example for the second option are the Interative Manipulation tool. However, the custom config does not include the window layout, and it only determines the initial state or RViz. The user can still customize everything, adding a degree of complexity that is not desired for applications targetet at non-expert users. There is no way of aiding the user by automatically changing the camera position etc.

Developers writing an interactive graphical system using rviz with Interactive Markers would like to assist their users by writing code which automatically positions the viewpoint to focus on task objects. The only way currently is to write a plugin, which has its own problems.

Other developers have also asked how they can programmatically add and remove displays in rviz. That is a similar problem which could be solved in similar ways.

Technical solution

A simple solution to this is to add a feature to rviz where it listens for messages which control the viewpoint. Perhaps though, if writing plugins were simpler, that method would be more attractive. There is a python scripting capability in rviz which I don't know much about. Perhaps a python script could solve the problem without changing the rviz source.

Another direction to look into is inspired by the RVE code which Josh Faust worked on before he left. The idea was to separate the display and rendering code into a library. The GUI program that is rviz would then be a user of that library, but other applications could be written with the library as well, using whatever UI elements and interaction behaviors the developers needed.

Separating RViz into a set of libraries would make it easier for developers to create their own full-fledged GUI based on the functionality found in RViz. It would be the last step in the hierarchy of ways to customize RViz, ordered by increasing complexity and control over the user experience:


2022-05-28 12:36