Rqt command line interface - killing plugins and switching perspectives
Hi everyone! :)
I am struggling with the (probably considered) advanced features of rqt
namely using the command line interface in order to control a running rqt
instance using IPC (inter-process communication). This question consists of two parts:
- Killing plugins started as separate processes
- Switching perspectives
System: Ubuntu 14.04, ROS Indigo (I think it was updated 2-3 months ago)
Killing plugins started as serparate processes
The question here is to find a workaround of the problem described in this section of the post.
Looking at the --help
of rqt
I got the following (do feel free to correct me if I'm wrong):
-m
(long:--multi-process
) - starts eachrqt
plugin as a separate process which means that I can get the PID of every pluging in order to manipulate it somehow using UNIX signals. Tested and working as described.--command-pid RQT_PID
- used in a combination with other--command-*
terminal parameters to control the runningrqt
instance (oldest one by default which is not something that I need to consider since my use case involves running just a single instance ofrqt
). Tested and working as described.--command-pid RQT_PID --command-start-plugin RQT_PLUGIN_NAME
- given the PID of the runningrqt
I can pass the name of arqt
plugin I want to start. Tested and working as described.Example:
rqt --command-pid 10816 --command-start-plugin rqt_rviz/RViz
addsrviz
the my runningrqt
So far so good. The problem is when I want to stop a plugin everything turns into...well...you know what. I was unable to find a rqt
-friendly way of doing that (there is for example no such command as --command-stop-plugin RQT_PLUGIN_NAME
) hence the only way that I have found so far is to send a SIGTERM
to the PID of the respective plugin.
I have tried using SIGINT
but it doesn't seem to work at all and also even when I use SIGTERM
the plugin still seems to be running (second image). I wrote seems since the processes is actually no longer there however the plugin (without its content!) remains and also under Running
in the menu I can still see Close RQT_PLUGIN_NAME
(see third image). Clicking on it doesn't do anything and the entry in the menu doesn't disappear. To be honest I find it very unlikely that anything but kill
is to be used to close externally such plugins because of the absence of a --command-stop-plugin ...
and the fact that the --command-start-plugin ...
takes just the rqt
plugin's name which begs the question "What will happen if I want to start and then stop N instances of the same plugin next to each other?"
Before SIGTERM to RViz plugin
After SIGTERM to RViz plugin (the plugin is still partially there)
After SIGTERM to RViz plugin (the plugin is still registered as a running plugin)
Things get even weirder when I reopen rqt
(without --clean-config
enable of course) - the "corrupted" plugin is loaded and (of course) it appears as one would expect from a pluging that ...