ros-visualization/rqt

rqt cannot find plugin after changing ROS_PACKAGE_PATH

bit-pirate opened this issue · 15 comments

For no obvious reason the rqt plugin I'm using (i.e. rqt_capabilities) suddenly stopped working with this error:

qt_gui_main() found no plugin matching "rqt_capabilities"

Removing the rqt gui config as described in this answer solved this issue.

Is this supposed to happen?

Did you changed the location where the rqt_capabilities package was located (e.g. switching from debs to a source checkout or moving a source package)?

You ran rqt in an environment with rqt_capabilities and then again in one without it, so the cache of rqt expected to find rqt_capabilities but couldn't.

At least that's my theory.

@dirk-thomas No.

@wjwwood I would say no, but I'm not 100% sure. I also couldn't reproduce the error following your description. Btw, I'm always using rosrun rqt_capabilities rqt_capabilities. So, I'm unable to run that plugin in an environment without it anyway.

Is the problem still there when you invoke it with --force-discover? (Please also post the version numbers of qt_gui_core and rqt.)

I'll try this, once I run into this bug again. I currently don't know how to reproduce this.

Is the problem still there when you invoke it with --force-discover?

No. This fixes it.

Please also post the version numbers of qt_gui_core and rqt.

qt_gui_core: 0.2.18-0precise-20131015-2036-+0000
rqt: not installed (ros-hydro-rqt)
rqt_gui: 0.2.18-0precise-20131015-2036-+0000

rqt (since a very recent version) caches the list and location of found plugins. It does that to improve the start-up time significantly. That means for 24h it reuses the previous discovery. If you add packages in the meantime rqt will not recrawl the filesystem and therefore not find them (until the cache expires or you invoke the program with the --force-discover option).

Can you please clarify what you did to run into the issue? You descriptions says that it was working before and suddenly stopped working. Did you do anything in between like source a different environment, change ROS_PACKAGE_PATH, add/remove/move packages?

Can you please clarify what you did to run into the issue? You descriptions says that it was working before and suddenly stopped working. Did you do anything in between like source a different environment, change ROS_PACKAGE_PATH, add/remove/move packages?

That was it! I'm using multiple workspaces. Switching between them can cause the mentioned error, if the cache has been initialised in workspace, which does not contain the plugin you are trying to load.

Maybe a quick fix would be showing a warning/info, which suggests to try --force-discover, when this error pops up?

I tend to use multiple workspaces as well, I was constantly getting the problem. A warning would be a good idea. Also a config option that turns off the cache so rqt always discovers on startup would be nice.

Well, the config option that turns off the cache is there: --force-discover
For making the multiple workspace scenario work better, I would suggest making the plugin cache dependent on the current ROS_PACKAGE_PATH.
So the cache file should contain a dictionary of plugin caches, one for each set of paths.

I was thinking something in ~/.rviz/config so I don't have to add --force-discover on every invocation.
Although I can just alias rqt='rqt --force-discover' to get that.

I've made a working example of using different plugin manager caches depending on the current ROS_PACKAGE_PATH in the branch "plugin_cache_prefix":
ros-visualization/qt_gui_core@231cfb1
0a0c180

It works for me, please test and comment.

+1 please create pull requests for those two branches. I will merge and release likely today since this is a pretty nasty bug.

@bit-pirate @markpitchless Can you please try the latest version from the git repos for qt_gui_core and rqt and confirm that they fix the issue for you when you switch between different environments?

Closing the ticket since it is assumed that the latest changes fix the problem.