Discussion : HMI Development with ROS 2

Hello everyone,

I had the need to develop a simple HMI for a previous project, and since I have NO experience at all in developing GUI applications, I resorted to using QtDesigner to create the interface, and then added ROS 2 callbacks to each button press and list information. It worked quite well for the project, but I was looking for a way to integrate the core visualisation component of RViz2 into my HMI, so that I do not have to open a separate program to “see” my robot and what it does. I know that FoxGlove Studio does a great job of visualising robot/sensor data, but in this context I was looking to have my HMI essentially “wrapped around” Rviz2.

I found that you can create a custom plugin for rqt, which is what I want but I don’t know if this feature has been ported into ROS 2 yet.

HMI development and management is not always a core focus of robotics engineers, as it takes a predominantly different set of skills to achieve a professional looking UI, skills that not all of us possess.
I would like to know if you ever had to create an HMI for your application, how you did it, and what tradeoffs you had to make (for my application, I sacrificed the aesthetics and a major part of visualisation to have ease of development). I know that the ROS client library rcl has been bindings for JavaScript, which I know to be used in UI development, but this question is coming more from a C++/Python user, who just needs a HMI with some buttons, and a way to visualise the robot inside the application.

Sorry for the long posts. This is a highly unedited version, if the mods wish to suggest changes or to edit the question further, that would be appreciated.

P.S.: I could not release the entire HMI I developed during my project, but I released a skeletal version of the HMI which can be edited by the user, and also documented my thoughts on this question. I welcome any improvements to my answer or my code. :smile:

Since it’s relevant I’ll shamelessly plug that you can use my ROS(2) module for QML to prototype and develop UIs quickly.
QML is IMHO magnitudes better than QtWidget-based UIs since responsiveness is very easy to develop and using and choosing the right animations to guide the user’s attention properly is integral to good UX.
Also, you don’t have to compile anything and can have the definition of the button and the logic of e.g. calling a service on click in the same file.
Here’s the ROS 1 version:

and here’s the ROS 2 version:

The ROS 1 version can also be overlaid on top of the RViz 3D view using this plugin:

A port to RViz2 should be possible but is still on the roadmap.

And here’s a short video of our interface built on top of RViz in use at a robotics competition:


I still have to finish that one PR I have open for it, but the QML plugin @StefanFabian mentions above would be my go-to for “a C++/Python user”.

I still fight with layouts, but that’s my shortcoming as a non-UI-guy. Hooking up some buttons and text boxes to topics and services is really not that hard any more with the QML plugin and a simple UI is easily created.


This looks quite nice ! I don’t have a lot of experience with QML to give you more feedback on the logic.

Maybe you can add some images of the generated HMI to show users what they can do with your code?

EDIT : Oops, was a bit late, I see you already added the visualisation, and oh wow, it looks very nice ! :clap: I am going to have to check out the code over the weekend

This looks very nice.

However, I am also a bit surprised that there are no example images to be found on GitHub or in the docs. But maybe I just haven’t found them.

You’re right, it would make sense to add some example images/videos. Unfortunately, I currently don’t have much time :frowning:

Note though that it is GPL licensed, which for many projects means that it cannot even be considered to use this…

The license file in the repo says it has an MIT license.

I assume we are not talking about the same repository. I am referring to this license file.

You are right. I was looking into the ROS (1) repo, which is MIT. The ROS 2 version is indeed GPL.

@StefanFabian what is the rationale behind this license?

Sorry for the late reply. I was on vacation.

Mostly because I’m not a fan of companies leeching off the work of open-source devs as they rarely contribute their fixes back and was intending more of a dual license model but since that would complicate the situation with PRs, I think I’ll just switch to MIT, as well, as in this instance this works better with the open-source spirit.

@Wilco @JRTG The ROS 2 version is now also MIT licensed.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.