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

rqt plugin Qt5 and 16.04 [closed]

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

McMurdo gravatar image

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

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: https://github.com/ksatyaki/rqt_myplugin 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

Comments

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 -0600 )edit

I edited the question

McMurdo gravatar image McMurdo  ( 2016-12-14 03:38:40 -0600 )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.

Thanks.

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

2 Answers

Sort by ยป oldest newest most voted
1

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

Dirk Thomas gravatar image

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

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
0

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

AndyZe gravatar image

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

McMurdo gravatar image

I don't have a specific answer, but here's a good example to start from: https://github.com/lucasw/rqt_mypkg

And a similar question that might be helpful: http://answers.ros.org/question/24939...

edit flag offensive delete link more

Comments

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

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

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)
else()
AndyZe gravatar image AndyZe  ( 2016-12-13 16:54:46 -0600 )edit
1

See https://github.com/UTNuclearRoboticsP...

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 -0600 )edit

Cool. Thanks!

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

Question Tools

1 follower

Stats

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

Seen: 906 times

Last updated: Dec 14 '16