ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A answers.ros.org

QML ROS Plugin Release

Greetings everyone,

it’s me again.
You might know me from posts such as C++ AnySubscriber and AnyPublisher ROS Babel Fish now available.
A release that probably was a leading cause of thoughts like “This is cool but what’s the point. Why would I need this?”
Wonder no more!
That release was the basis for my newest release:

License: MIT
Mainly tested with: Ubuntu 20.04 + ROS Noetic

Some people might have already seen this repository since it was public for quite a while already.
However, I wasn’t yet comfortable with sharing it since it was still in alpha stadium.
There may still be bugs but I’ve used it for quite a while now, hence, I think this is a good time to share it.

What does it do?
The QML ROS Plugin is a module (yes I know it should be called QML ROS Module) for QML that allows connecting QML interfaces with ROS.

What is QML?
QML is a user interface markup language by Qt which is marketed as a competitor to HTML5 apps.
It is a graphics accelerated declarative interface language.
A JavaScript engine allows the usage of JavaScript to add logic and interactivity to the interface and can also interface with C++. This is also how you would interact with the module to, for example, call a service when a button is clicked.
It’s not perfect but it’s far simpler, faster, and easier to use than QWidgets.

Related Work
There are of course other modules that aimed to add some ROS support.
However, all of them only have limited support for a few common message types, and the only plugin that supports image transport uses a hack instead of the natively supported approach.
This is the only module to my knowledge that (thanks to ROS BabelFish) supports all messages, services, and actions (even your custom ones).

Example


Here’s an example of a user interface, we have developed in QML using this module.
As you may have noticed, the QML interface is overlayed on top of the RViz 3D scene.
It also features the colored pointcloud my colleague briefly mentioned in his release of the Image Projection Library - Open Source Release.

There are also some getting started examples in the examples folder of the repo.

TL;DR
QML ROS Module Plugin is out now and allows full interaction between QML based user interfaces and ROS without having to rely on custom C++ wrappers. All message, service, and action types are supported!

More information
I’m presenting this work and ROS2 ports (though it’s not really a port if you have to rewrite 90% because they work completely different) at the European Conference on Mobile Robots (ECMR) 2021.
You can read more about how it works in the paper or register for free for the ECMR and join my demo of the ROS1 version: 2.9. 15:30 | Interactive Session 4: Human-Robot Interaction and Teleoperation – ECMR 2021 (Time is in CEST)
On that link, you can also see a nice teaser video that was created entirely in QML. All animations, subtitles, etc. were done in QML and screen captured.

I hope these packages will help you and make developing great-looking 2D robot user interfaces easier!
Feel free to reach out to me if you have something cool to show off!

What about ROS2?
Coming soon™. No really, the software is basically done but it still requires some changes in the ROS2 core libraries. It will also be an alpha release and I might change some APIs to fit better with ROS2 conventions.

4 Likes

Hi Stefan, that looks fancy! Is the code for overlaying QML ontop of rviz also part of that package?

Thank you!
It is not but it is part of the packages released as part of the ECMR paper.
You can find the code for that here:

Unfortunately, this is a bit hacky and there are some minor issues when rendering a Qt interface framework (QtWidget or QML) into a QApplication.
Focus for example doesn’t work that great with that.

1 Like

So the RViz display is still a QWidget in this case?

Oh no, the example you can see here is QML.
It’s still work in progress but I find QML way easier to work with than QWidgets.
Our old user interface was a QWidget and development was quite the hassle since you have to compile it after each change.
For QML overlays, hector_rviz_overlay even supports live reloading whenever one of the files changed (doesn’t have to be the main QML file).
It’s also not perfect (singletons are not updated) but it allows for very quick development.

Btw I’ve seen your work on RViz 2 in QML, what’s the current state with that?
I would love to integrate a less hacky solution for overlays in RViz 2.

1 Like