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

move_base crashes with custom global planner whenever instantiating base_local_planner::CostmapModel

asked 2015-08-05 16:23:00 -0600

Sebastian gravatar image

I have written my own global planner and have successfully registered the plugin so that move_base can detect it.

I am getting a problem where move_base will crash whenever I instantiate an instance of base_local_planner::CostmapModel.

I've removed all the code from my global planner so that it will run as a plugin that does nothing. This is what my initialize function looks like:

void FrontierPlanner::initialize(string name, Costmap2DROS* costmap_ros)
{
    map = costmap_ros;
    Costmap2D* costmap = map->getCostmap();
    base_local_planner::CostmapModel model(*costmap); //The offending line
}

This will cause move_base to crash. If I comment out the third line then it will run no problem. It compiles in both cases as well.

The error move_base gives me is:

 [FATAL] [1438809026.524028208]: Failed to create the bob/FrontierPlanner planner, are you sure it is properly registered and that the containing library is built? Exception: Failed to load library /home/viki/catkin_ws/devel/lib//libfrontier_planner_lib.so. 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/viki/catkin_ws/devel/lib//libfrontier_planner_lib.so: undefined symbol: _ZTVN18base_local_planner12CostmapModelE)
[move_base-5] process has died [pid 2554, exit code 1, cmd /opt/ros/indigo/lib/move_base/move_base __name:=move_base __log:=/home/viki/.ros/log/6207c02a-3bb6-11e5-8754-080027c434d6/move_base-5.log].
log file: /home/viki/.ros/log/6207c02a-3bb6-11e5-8754-080027c434d6/move_base-5*.log

Any ideas?

edit retag flag offensive close merge delete

Comments

Can you please give some more details (maybe link to a gist)? Showing your *plugin.xml for this planner, more details on the implementation as well as the CMakeLists.txt and package.xml.

Otherwise, we can only guess... But something seems to be wrong the way you export your library...

mgruhler gravatar image mgruhler  ( 2015-08-06 02:18:52 -0600 )edit

I forgot a target_link_libraries in my CMakeLists.txt. I wasn't linking the library with my plugin to catkin_libraries.

Sebastian gravatar image Sebastian  ( 2015-08-06 13:20:15 -0600 )edit

can you then post your solution as an answer and mark it as correct? Helps keeping ROS Answers clean ;-)

mgruhler gravatar image mgruhler  ( 2015-08-07 01:00:36 -0600 )edit

I can't accept my own answer because I don't have a high enough reputation lol

Sebastian gravatar image Sebastian  ( 2015-08-07 12:41:24 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-08-07 12:18:18 -0600

Sebastian gravatar image

I forgot to target_link_libraries in my CMakeLists.txt file. I wasn't linking the library with my plugin to catkin_libraries.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-08-05 16:23:00 -0600

Seen: 656 times

Last updated: Aug 07 '15