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

Creating rqt plugin

asked 2016-12-18 23:42:07 -0500

Azhar gravatar image

updated 2016-12-20 22:03:16 -0500

this is my package:

When I open rqt and try to open the plugin from the drop-down menu using the following steps

cd ~/catkin_ws
source ~/catkin_ws/devel/setup.bash
rqt --force-discover

I can see the name of my package when in the rqt gui, but when i click it,

I get the following error in the terminal output:

[ERROR] [1482121854.496133919]: Failed to load nodelet [rqt_test1/MyPlugin_1] of type [rqt_test1/MyPlugin]: MultiLibraryClassLoader: Could not create object of class type rqt_test1::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_test1/MyPlugin) failed creating instance
PluginManager._load_plugin() could not load plugin "rqt_test1/MyPlugin": RosPluginlibPluginProvider.load() could not load plugin "rqt_test1/MyPlugin"

i think it has to do with the registration of the plugin. any form of guidance will be helpful. Thank you.

Plugin.xml :


<library path="lib/librqt_test1">

 <class name="rqt_test1/MyPlugin" type="rqt_test1::MyPlugin" base_class_type="rqt_gui_cpp::Plugin">


4 buttons to switch between 4 different modes.





    <statustip>Plugins related to visualization.</statustip>



 <statustip>4 buttons to switch between 4 different modes.</statustip>



edit retag flag offensive close merge delete



i think it has to do with the registration of the plugin

If you feel that is the case, then please include at least a snippet of code where you show how you implemented that bit.

This question will become worthless otherwise if/when your repository is removed/deleted/changed.

gvdhoorn gravatar image gvdhoorn  ( 2016-12-19 03:09:34 -0500 )edit

I have edit the question. let me know if there are any other things you need. Thank you!

i have not changed my repository!

Azhar gravatar image Azhar  ( 2016-12-19 03:58:23 -0500 )edit

So where is the code where you actually register your plugin (or really: export it / make it known to class loader)? Please include that in your question.

gvdhoorn gravatar image gvdhoorn  ( 2016-12-19 05:41:34 -0500 )edit

From a quick glance, I don't see anything to cause that error. But you can delete this from CMakeLists:

install(PROGRAMS scripts/${PROJECT_NAME}/
AndyZe gravatar image AndyZe  ( 2016-12-19 13:27:40 -0500 )edit

@AndyZelenak, i tried it but it doesn't help. same error ;(

Azhar gravatar image Azhar  ( 2016-12-20 22:55:18 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-12-21 12:48:47 -0500

AndyZe gravatar image

updated 2016-12-21 12:59:31 -0500

Compare your main.cpp to my_plugin.cpp. You don't have this line at the bottom:

PLUGINLIB_DECLARE_CLASS(rqt_gauges, MyPlugin, rqt_gauges::MyPlugin, rqt_gui_cpp::Plugin)

And you're missing this function (which seems important):

void MyPlugin::initPlugin(qt_gui_cpp::PluginContext& context)

So go back and spend some time fixing those obvious issues. I think we would be more motivated to help if you upvoted good answers, too.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-12-18 23:42:07 -0500

Seen: 461 times

Last updated: Dec 21 '16