Ask Your Question
0

Creating rqt plugin

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

Azhar gravatar image

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

this is my package: https://github.com/azhar92/GUI-for-AV...

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

cd ~/catkin_ws
catkin_make
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 : https://github.com/azhar92/GUI-for-AV...

Code:

<library path="lib/librqt_test1">

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

   <description>

4 buttons to switch between 4 different modes.

</description>

 <qtgui>

  <group>

   <label>Visualization</label>

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

  </group>

 <label>test1</label>

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

 </qtgui>

</class>

</library>
edit retag flag offensive close merge delete

Comments

1

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 imagegvdhoorn ( 2016-12-19 03:09:34 -0600 )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 imageAzhar ( 2016-12-19 03:58:23 -0600 )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 imagegvdhoorn ( 2016-12-19 05:41:34 -0600 )edit
1

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}/gauge_script.py
  DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
AndyZe gravatar imageAndyZe ( 2016-12-19 13:27:40 -0600 )edit

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

Azhar gravatar imageAzhar ( 2016-12-20 22:55:18 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

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

AndyZe gravatar image

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

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 255 times

Last updated: Dec 21 '16