[Documentation] [TitleIndex] [WordIndex

Errors when using pluginlib

Error: Manifest class mismatch

user@prX: Failed to load library [library_path] Error string: Cannot load library: Manifest class mismatch in [library_path]: [class_type]

Meaning: This error occurs when the templated type of the base class for the pluginlib::ClassLoader does not match the type registered with the PLUGINLIB_DECLARE_CLASS macro (PLUGINLIB_REGISTER_CLASS in boxturtle). To fix this, the base class of both the macro and the pluginlib::ClassLoader must match. Also the macro usage must not be inside a namespace.

Error: No manifest

user@prX: Failed to load library [library_path] Error string: Cannot load library: No manifest in [library_path]: [class_type]

Meaning: This error occurs when the PLUGINLIB_REGISTER_CLASS macro isn't called by a plugin provider. The macro must be called for every class that the pluginlib::ClassLoader intends to load. This error also arises if PLUGINLIB_REGISTER_CLASS isn't being called at all. This can happen if your source files aren't actually built into your library.

Error: Plugin not built

user@prX [ERROR] [timestamp]: Failed to load line. Exception: Failed to load library [libary_path] Error string: Cannot load library: [library_path]: cannot open shared object file: No such file or directory

Meaning: The shared object which the plugin description file describes does not exist.

Solution:

catkin_make PLUGIN_PROVIDER_PACKAGE

Error: Plugin failed to load

[ERROR] 1275383425.777863000: RobotModel : mobile base plugin failed to load, error: According to the loaded plugin descriptions the class DiffDriveBase with base class type mobile_base_interface::MobileBase does not exist. Declared types are  [DiffDriveBase][mobile_base]

Meaning: It can't find the plugin xml file.

Solution: Usually this happens if you forget to add the export in the manifest, or create it as a second export tag in the manifest (only one export permitted!).

For example, the following excerpt from a manifest caused the above failure (solution, wrap the contents in just one set of export tags).

  <export>
    <cpp cflags="-I${prefix}/include" lflags="-Wl,-rpath,${prefix}/lib -L${prefix}/lib -lycs_diff_drive_base"/>
  </export>
  <export>
    <mobile_base_interface plugin="${prefix}/diff_drive_base_plugin.xml" />
  </export>

Error: Segfaults when Using the Instance

Meaning: The class loader instance absolutely must survive longer than the created instance.

If the class loader goes out of scope too early, the plugin library gets unloaded and any future uses of the instance pointer will cause the program to segfault. This can sometimes be a little non-obvious:

class DeviceManager {
public:
    DeviceManager() :
        pluginlib::ClassLoader<Device> device_loader("device_interface", "device_interface::Device") {
        Device *device_ptr = NULL;
        try {
             device_ptr = device_loader.createClassInstance("Goo");
        } catch(PluginlibException& ex){ return; }
        device = boost::shared_ptr<Device>(device_ptr);
    }

private:
    boost::shared_ptr<Device> device;
    ClassLoader<DeviceNode> device_loader;
}

The above code will gloriously fail when destructing the object, since the library will unload before the shared pointer's allocated object can call its own destructor. Either declaring the loader before the shared pointer, or explicitly calling device.reset() in the class's destructor will solve the problem.

Reporting Errors

If you encounter a problem that isn't addressed on this page, please file a ticket

The current list of open issues is available on Github


2024-11-16 14:50