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

Cross-package PluginLib Library Loading Error

asked 2012-06-22 11:08:06 -0500

David Lu gravatar image

updated 2012-06-24 17:08:39 -0500

Setup:

  • Package A (costmap_2d) - Defined new plugin bass class costmap_2d::CostmapPlugin
  • Package B (static_costmap_plugin) - Define plugin costmap_plugins::StaticCostmapPlugin
    • In Manifest: <export> <costmap_2d plugin="${prefix}/costmap_plugins.xml" /> </export>
    • costmap_plugins.xml:

<library path="lib/libcostmap_plugins">

<class name="static_costmap_plugin/static_costmap" type="costmap_plugins::StaticCostmap" base_class_type="costmap_2d::CostmapPlugin">

<description>Uses a static costmap</description>

</class> </library>

  • Plugin Declaration: PLUGINLIB_DECLARE_CLASS(costmap_plugins, static_costmap, costmap_plugins::StaticCostmapPlugin, costmap_2d::CostmapPlugin)

Error:

terminate called after throwing an instance of 'pluginlib::LibraryLoadException'
  what():  Failed to load library /home/dlu/ros/nav_experimental/static_costmap_plugin/lib/libcostmap_plugins.so. Make sure that you are calling the PLUGINLIB_REGISTER_CLASS macro in the library code, and that names are consistent between this macro and your XML. Error string: Cannot load library: No manifest in /home/dlu/ros/nav_experimental/static_costmap_plugin/lib/libcostmap_plugins.so: static_costmap_plugin__static_costmap
Aborted
edit retag flag offensive close merge delete

Comments

To get this to work, what are the main differences between what you did and the tutorial? The main thing I would like to know is in which package did you declare you're plugin and if you had to turn your base class into a shared library for Package B to link with its plugin.

candronikos gravatar image candronikos  ( 2013-07-04 15:13:29 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2012-07-05 11:30:27 -0500

David Lu gravatar image

I figured it out on my own.

Problem 1: The type attribute in the costmap_plugins.xml should refer to the namespaced version of the implementation class. Ergo costmap_plugins::StaticCostmap should be static_costmap_plugin::StaticCostmapPlugin.

Problem 2: The same applies to the first parameter of PLUGINLIB_DECLARE_CLASS

PLUGINLIB_DECLARE_CLASS(static_costmap_plugin, static_costmap, static_costmap_plugin::StaticCostmapPlugin, costmap_2d::CostmapPlugin)

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-06-22 11:08:06 -0500

Seen: 1,268 times

Last updated: Jul 05 '12