Skip to content

rqt_embed_window is a rqt_gui plugin that allows to embed any graphical application as a rqt widget

Notifications You must be signed in to change notification settings

awesomebytes/rqt_embed_window

Repository files navigation

rqt_embed_window

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:

Screenshot of SimpleScreenRecorder, Rviz, Plotjuggler, rosbag_editor and a normal rqt_console

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).

Usage

Example usage in rqt_gui

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.

Things that didn't work for me

terminator, gnome-terminal, LibreOffice, kivy-based apps

How to try if an app works quickly

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.

Workarounds for complex commands/programs

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.

Useful examples

Find here suggestions of commands that may be useful (these are to be added in the popup of the plugin).

Run rviz with a config file

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.

Run plotjuggler

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.

Run rosbag_editor

rosrun rosbag_editor rosbag_editor

Thanks

Thanks to @leggedrobotics, specially @samuelba, for the catkin_create_rqt package which made cooking the first version of this package quick and painless.

About

rqt_embed_window is a rqt_gui plugin that allows to embed any graphical application as a rqt widget

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published