Embed any graphical program window into a rqt_ plugin. The ultimate productivy tool!
Warning: This is a hacky approach. The plugin executes your program and captures the window to embed it in rqt_gui.
Notable examples of applications that are embeddable(*) with rqt_embed_window
:
- Plotjuggler Helping the awesome @facontidavide to be able to use it alongside Rviz/Rqt as some people requested.
- Rviz Works without crashes unlike rqt_rviz Issue #6. (The main motivation for this work).
- rosbag_editor Another seriously awesome tool by @facontidavide.
Other maybe useful or fun ones:
- Google Chrome (if you have an already existing web interface)
- VLC
- Slack
- Wireshark
- SimpleScreenRecorder
- Visual Studio Code
- Some games like Slay the Spire
- Another instance of rqt_gui
(*) Caveat: Some drag-and-drop behaviours sometimes don't work. As far as I investigated, the problem is that the embedded app does not receive those events (investigated on a Qt app). Some apps have workarounds (see below).
Open rosrun rqt_gui rqt_gui
, go to Plugins
> Miscellaneous Tools
> Embed a graphical program window into RQT
.
You'll be prompted for the commandline for the program (which will be executed in the plugin), for example rviz -s None
.
Note: Doing -s None
disables the splashscreen, which is necessary to get the correct PID and Window ID internally.
You can export your perspective and load it later as any other.
terminator, gnome-terminal, LibreOffice, kivy-based apps
Use the test_if_window_can_be_embedded.py
script providing it the PID of the window you want to test.
You can find the PID by means of ps aux | grep program-name
or pstree -p
and look for the process that inherits the rest.
You can also use xwininfo
and click on the window and manually modify the script to use the window id provided.
If your program needs a long set of parameters or environment variables, set it up in a bash
script and call it from rqt_embed_window, however, you must make sure to prepend the binary with exec
so the PID reported to rqt_embed_window is the actual PID of the program itself and not the
shell that is executing it.
Find here suggestions of commands that may be useful (these are to be added in the popup of the plugin).
rviz --splash-screen None --display-config my_rviz_config.rviz
Workaround needed to re-order displays (done by dragging the item) in the Displays panel,
you must create your .rviz
config file in a non-embedded Rviz. Other dragging actions seem to work.
plotjuggler --nosplash --layout my_layout.xml
Workaround needed to drag data sources from the left panel, drag-and-drop doesn't work, so you must
create the layout (with the Save data sources
option enabled) for the embedded plotjuggler before hand in a non-embedded plotjuggler.
rosrun rosbag_editor rosbag_editor
Thanks to @leggedrobotics, specially @samuelba, for the catkin_create_rqt package which made cooking the first version of this package quick and painless.