ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

rqt plugin Qt5 and 16.04 [closed]

asked 2016-12-13 11:37:43 -0500

McMurdo gravatar image

updated 2016-12-14 03:38:29 -0500

I'm trying to create a rqt plugin. I've tried to mimic the rqt_image_view package as much as possible.

When I open rqt and try to open the plugin from the drop-down menu, I get the following error in the terminal output:

[ERROR] [1481649833.824410737]: Failed to load nodelet [rqt_myplugin/MyPlugin_1] of type [rqt_myplugin/MyPlugin]: MultiLibraryClassLoader: Could not create object of class type rqt_myplugin::MyPlugin as no factory exists for it. Make sure that the library exists and was explicitly loaded through MultiLibraryClassLoader::loadLibrary()
RosPluginlibPluginProvider::load_explicit_type(rqt_myplugin/MyPlugin) failed creating instance
PluginManager._load_plugin() could not load plugin "rqt_myplugin/MyPlugin": RosPluginlibPluginProvider.load() could not load plugin "rqt_myplugin/MyPlugin"

What could be the error?

Here is the package: It seems to work with force discover option. I don't understand what this option does exactly. Previously I even tried installing the plugin to /opt/ros/kinetic. It didn't work.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by McMurdo
close date 2017-03-01 10:44:37.234982


The error message indicates a problem with the plugin registration. If you could share your code it might be possible to spot the different to other working plugins.

Dirk Thomas gravatar image Dirk Thomas  ( 2016-12-13 17:01:41 -0500 )edit

I edited the question

McMurdo gravatar image McMurdo  ( 2016-12-14 03:38:40 -0500 )edit

@McMurdo: if you feel your question has been answered, please don't close it, but instead accept one of the answers by ticking the checkmark to the left of it. That makes it much clearer from the question list that the question is in fact answered, and not closed for some other reason.


gvdhoorn gravatar image gvdhoorn  ( 2016-12-14 13:10:04 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2016-12-14 16:50:51 -0500

Dirk Thomas gravatar image

updated 2016-12-14 16:53:50 -0500

The operation to gather a list of available ROS packages is an expensive operation because it needs to crawl recursively through the file system. Therefore the tools cache the result for a certain amount of time. The command line option --force-discover enforces a crawling (ignoring the cache) and therefore ensures that you get an up-to-date result.

rospack has a rather short maximum age for the cache (60s). rqt on the other hand reuses the cache for a pretty long time of (1 day).

edit flag offensive delete link more

answered 2016-12-13 14:50:24 -0500

AndyZe gravatar image

updated 2016-12-14 17:00:53 -0500

McMurdo gravatar image

I don't have a specific answer, but here's a good example to start from:

And a similar question that might be helpful:

edit flag offensive delete link more


That example, unfortunately, is no good. It uses Qt4.

McMurdo gravatar image McMurdo  ( 2016-12-13 16:34:48 -0500 )edit

In my CMakeLists, there's this to account for either version:

if("${qt_gui_cpp_USE_QT_MAJOR_VERSION} " STREQUAL "5 ")
  find_package(Qt5Widgets REQUIRED)
  qt5_wrap_cpp(rqt_gauges_MOCS ${rqt_gauges_HDRS})
  qt5_wrap_ui(rqt_gauges_UIS_H ${rqt_gauges_UIS})
  set(qt_LIBRARIES Qt5::Widgets)
AndyZe gravatar image AndyZe  ( 2016-12-13 16:54:46 -0500 )edit


I got that from one of Dirk's plugins somewhere. Can't remember which anymore.

AndyZe gravatar image AndyZe  ( 2016-12-13 16:54:59 -0500 )edit

Cool. Thanks!

McMurdo gravatar image McMurdo  ( 2016-12-14 03:39:30 -0500 )edit

Question Tools

1 follower


Asked: 2016-12-13 11:37:43 -0500

Seen: 866 times

Last updated: Dec 14 '16