Rosanswers logo

Is it possible to load a plugin developed in a separate package without declaring it in the package where the base class resides? Would it be enough to declare the plugin in the .cpp file where the actual plugin lives?

When I tried this, I got the error:

[ERROR] [1372978694.271503470]: The plugin failed to load for some reason. Error: According to the loaded plugin descriptions the class amigctrl_plugin/AmigoBot with base class type cruise_plugin_base::PBase does not exist. Declared types are  cruise_core/amigo_locomotion_plugin

So the plugin that I developed isn't listed here. Just the one that exists in the original package. Can plugins only be declared in the package where they are to be loaded? Is there a way around this?

EDIT: Fixed one error, another came up to go. First, for reference:

    <pkg_name plugin="${prefix}/plugin.xml" />

The tag "pkg_name" must be the name of the package where the base class resides. I named it the package name of the actual plugin.

Now we have a new runtime error, saying:

terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct null not valid
Aborted (core dumped)

Any advice on this would be appreciated.

Originally posted by candronikos on ROS Answers with karma: 26 on 2013-07-04

Post score: 1


2 Answers 2


Rosanswers logo

A good place to look would be http://www.ros.org/wiki/pluginlib. Possibly just a missing xml or export.

Originally posted by weiin with karma: 2268 on 2013-07-04

This answer was NOT ACCEPTED on the original site

Post score: 1

Original comments

Comment by candronikos on 2013-07-04:
Seemed to be the case. The the tag in the export section in the manifest.xml has to be the name of the package where the base class resides. I made it the name of the package that the plugin resides. Now I'm getting another runtime error. Details above.

Comment by weiin on 2013-07-04:
Hard to tell just based on that error line. Most likely you need to check through your plugin code for bugs.


Rosanswers logo

Ok I fixed it myself. What I did was:

  1. Compile the base class into a library (Done is CMakeLists.txt)
  2. Export that library from the base class manifest (Done in manifest.xml in Fuerte)
  3. Depend on the base class package from the plugin packages manifest
  4. Plugin can be declared in a source file within the package where the plugin resides
  5. Export the plugin library (Done in the plugin package manifest.xml)

My only problem was confusing all the names it works now.

Originally posted by candronikos with karma: 26 on 2013-07-07

This answer was ACCEPTED on the original site

Post score: 0

Original comments

Comment by rem870 on 2013-08-17:
i also have a pluginlib in a package and want to use it in another package. i have followed the plugin tutorial. i get an error error: cannot convert ‘boost::shared_ptrkinematics::KinematicsBase’ to ‘kinematics::KinematicsBase*’ in assignment.

this is my program on the begining: pluginlib::ClassLoaderkinematics::KinematicsBase poly_loader("kinematics_base", "kinematics::KinematicsBase"); kinematics::KinematicsBase* kinbase=NULL;


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.