ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Problem with new BaseGlobalPlanner plugin

asked 2014-04-29 00:06:42 -0500

Stefano Primatesta gravatar image

updated 2014-04-29 21:25:13 -0500

I tried to make a new BaseGlobalPlanner plugin for use with move_base. In this Plugin I use ros-hydro-ompl package.

After I've created .cpp and .h (that include ompl library) file, I've compiled with catkin_make and everything works! All the dependencies seem to be satisfied.

But when I run plugin I show this error:

[FATAL] [1398764927.385890076, 2.100000000]: Failed to create the ompl_planner_rrt/OMPLPlannerRRT planner, are you sure it is properly registered and that the containing library is built? Exception: Failed to load library /home/prima/catkin_ws/devel/lib// Make sure that you are calling the PLUGINLIB_EXPORT_CLASS macro in the library code, and that names are consistent between this macro and your XML. Error string: Could not load library (Poco exception = /home/prima/catkin_ws/devel/lib// undefined symbol: _ZTVN4ompl4base18CompoundStateSpaceE)

The name between PLUGINLIB_EXPORT_CLASS macro and XML file is correct!

This is the macro in .cpp file

PLUGINLIB_EXPORT_CLASS(ompl_planner_rrt::OMPLPlannerRRT, nav_core::BaseGlobalPlanner)

this is .xml file:

<library path="lib/libompl_planner_rrt">
  <class name="ompl_planner_rrt/OMPLPlannerRRT" type="ompl_planner_rrt::OMPLPlannerRRT" base_class_type="nav_core::BaseGlobalPlanner">
      A implementation of RRT

The undefined symbol ompl4base18CompoundStateSpace is a ompl function (ompl::base::CompoundStateSpace). It seems that in runtime there aren't dependencies with ompl package.

This is my CMakeLists.txt file:

cmake_minimum_required(VERSION 2.8.3)

find_package(catkin REQUIRED COMPONENTS


find_package(Boost REQUIRED COMPONENTS system thread)
  INCLUDE_DIRS include
  LIBRARIES ompl_planner_rrt
  CATKIN_DEPENDS roscpp nav_core pluginlib
  DEPENDS system_lib



   ${OMPL_LIBRARIES} #added on the advice of ahendrix

and package.xml:

<?xml version="1.0"?>
  <description>The ompl_planner package</description>



     <nav_core plugin="/home/prima/catkin_ws/src/ompl_planner_rrt/bgp_plugin.xml" />

When I show this:

ldd '/home/prima/catkin_ws/devel/lib/'

I don't find, I suppose this is the problem.

Can anyone help me? Thanks

edit retag flag offensive close merge delete


I wanna ask you a question. Did you try sudo apt-get install ros-hydro-ompl? I also try it, because I have never installed ompl.

Ken_in_JAPAN gravatar image Ken_in_JAPAN  ( 2014-04-29 04:42:14 -0500 )edit

I knew you were correct, after installing ompl package . The package included only source.

Ken_in_JAPAN gravatar image Ken_in_JAPAN  ( 2014-04-29 04:57:57 -0500 )edit

I've already install ompl package. I only run sudo apt-get install ros-hydro-ompl, I hope it's enough.

Stefano Primatesta gravatar image Stefano Primatesta  ( 2014-04-29 09:59:23 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-04-29 06:46:25 -0500

ahendrix gravatar image

It looks like your planner library isn't linked against OMPL.

Try linking it against ompl by adding the following to your CMakeLists.txt:

target_link_libraries(ompl_planner_rrt ${ompl_LIBRARIES})

(NOTE: this assumes that the find_package command for OMPL is exporting its libraries in the ompl_LIBRARIES variable. if it isn't, or the variable name is different, you'll have to make the appropriate adjustments above)

edit flag offensive delete link more


I tried to do that, but nothing changes.

Stefano Primatesta gravatar image Stefano Primatesta  ( 2014-04-29 10:04:00 -0500 )edit

Is there a command to link manually How Can I add to my CMakeLists.txt?

Stefano Primatesta gravatar image Stefano Primatesta  ( 2014-04-29 21:28:16 -0500 )edit

Hi @Prima89:You executed sudo apt-get install at first. At that time, is located in /opt/ros/hydro/lib and source file is located in /opt/ros/hydro/share. I think so because I tried. So how did you replace the location to ~/catkin_ws/?

Ken_in_JAPAN gravatar image Ken_in_JAPAN  ( 2014-04-30 04:10:11 -0500 )edit

You can manually link to OMPL with target_link_libraries(ompl_planner_rrt ompl)

ahendrix gravatar image ahendrix  ( 2014-04-30 06:05:58 -0500 )edit

Hi @Ken_in_JAPAN In catkin_ws there is only my package for the plugin. Others packages are in opt/ros/hydro/share with libraries in opt/ros/hydro/lib.

Stefano Primatesta gravatar image Stefano Primatesta  ( 2014-04-30 06:14:04 -0500 )edit

@Prima89: Thanks for replying early. I got it. But I don't help you. So sorry!

Ken_in_JAPAN gravatar image Ken_in_JAPAN  ( 2014-04-30 07:05:13 -0500 )edit

Thanks @ahendrix !!! It works, I only add target_link_libraries(ompl_planner_rrt ompl)

Stefano Primatesta gravatar image Stefano Primatesta  ( 2014-05-01 06:05:17 -0500 )edit

Hello @Prima89: I also want to use same plugin with Turtlebot. I'm sorry, but could you show me your *.cpp and *.h?

Ken_in_JAPAN gravatar image Ken_in_JAPAN  ( 2014-05-14 16:21:01 -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



Asked: 2014-04-29 00:06:42 -0500

Seen: 2,298 times

Last updated: Apr 29 '14