Ask Your Question
4

PLUGINLIB_DECLARE_CLASS vs PLUGINLIB_REGISTER_CLASS

asked 2011-10-17 13:58:14 -0500

seanarm gravatar image

updated 2011-10-17 13:59:04 -0500

I created my own kinematics plugin, akin to pr2_arm_kinematics_plugin.cpp. My intention is for it to be used by ompl_motion_planner, also like pr2_arm_kinematics_plugin in the case of the pr2_object_manipulation_launch demo. I added all the necessary ingredients (I think)-- CMakeLists that creates the plugin library, a kinematics_plugin.xml that specifies the package/class/type of the plugin, a manifest that exports the library and kinematics_plugin.xml.

When I launch ompl_motion_planner, it does find my plugin:

/opt/ros/diamondback/stacks/motion_planners/ompl_ros_interface/src/ik/ompl_ros_ik_sampler.cpp (57): Found solver my_namespace/MyKinematicsPlugin

However, it throws the error:

/opt/ros/diamondback/stacks/motion_planners/ompl_ros_interface/src/ik/ompl_ros_ik_sampler.cpp (65): The plugin failed to load. Error: Failed to load library /path/to/my_kinematics/lib/libmy_kinematics_lib.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 /path/to/my_kinematics/lib/libmy_kinematics_lib.so: my_namespace__MyKinematicsPlugin

The lib does exist at the specified path.

The error is confusing, because the way I understand it from the wiki is that PLUGINLIB_REGISTER_CLASS is the boxturtle version of PLUGINLIB_DECLARE_CLASS. I have the former at the top of my my_knematics_plugin.cpp file. Any clues?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2011-10-18 01:31:38 -0500

DimitriProsser gravatar image

updated 2011-10-18 01:34:29 -0500

I believe you should be using the PLUGINLIB_DECLARE_CLASS macro, not PLUGINLIB_REGISTER_CLASS. I say this because REGISTER is for the boxturtle release of ROS. Since your package path says that you're using diamondback, your version of pluginlib will not be the same as the one from boxturtle. This will cause a conflict and the error that you're seeing. It says on the wiki page that ompl supports Diamondback, so I would check your version of pluginlib, just to be sure.

edit flag offensive delete link more

Comments

A ticket to fix the error message would be appreciated. I expect the error message was not updated at the time the macro was updated.
tfoote gravatar imagetfoote ( 2011-10-18 08:12:52 -0500 )edit

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2011-10-17 13:58:14 -0500

Seen: 1,265 times

Last updated: Oct 18 '11