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

unable to integrate local planner plugin into move_base

asked 2021-07-13 17:11:16 -0600

updated 2021-07-13 17:15:17 -0600

I am trying to integrate my local path planner plugin into move_base. On launching the modified move_base launch file, I am getting the following error -

[FATAL] [1626211675.635218297, 96.984000000]: Failed to create the local_planner/LocalPlanner planner, are you sure it is properly registered and that the containing library is built? Exception: Failed to load library /home/skpro19/catkin_ws/devel/lib//liblocal_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/skpro19/catkin_ws/devel/lib//liblocal_planner_lib.so: undefined symbol: _ZN13local_planner12LocalPlannerD1Ev)
[move_base-1] process has died [pid 26446, exit code -11, cmd /home/skpro19/catkin_ws/devel/lib/move_base/move_base /odom:=odometry/filtered __name:=move_base __log:=/home/skpro19/.ros/log/29b07b08-e421-11eb-b77b-c8e2656b0bb1/move_base-1.log].
log file: /home/skpro19/.ros/log/29b07b08-e421-11eb-b77b-c8e2656b0bb1/move_base-1*.log

Also, is it normal that it is looking for the library at lib//lib_local_planner_lib instead of lib/lib_local_planner_lib ? I am also curious about the undefined symbol: _ZN13local_planner12LocalPlannerD1Ev part.

I have inserted the line PLUGINLIB_EXPORT_CLASS(local_planner::LocalPlanner, nav_core::BaseLocalPlanner); in my source (my_local_planner_ros.cpp) file.

I am attaching my CMakeLists.txt, package.xml and local_planner_plugin.xml files below.

CMakeLists.txt

cmake_minimum_required(VERSION 3.0.2)
project(my_local_planner)

add_compile_options(-std=c++11)

find_package(catkin REQUIRED COMPONENTS

    base_local_planner
    costmap_2d
    #dynamic_reconfigure
    nav_core
    nav_msgs
    pluginlib
    sensor_msgs
    roscpp
    tf2
    tf2_geometry_msgs
    tf2_ros
)

#find_package(Eigen3 REQUIRED)
#remove_definitions(-DDISABLE_LIBUSB-1.0)
find_package(Boost REQUIRED COMPONENTS system)

catkin_package(
    CATKIN_DEPENDS
        base_local_planner
        #dynamic_reconfigure
        nav_msgs
        pluginlib
        sensor_msgs
        roscpp
        tf2
        tf2_ros
)

include_directories(
    include
    ${catkin_INCLUDE_DIRS}
    ${Boost_INCLUDE_DIRS}

)
#add_definitions(${EIGEN3_DEFINITIONS})

# dynamic reconfigure
#generate_dynamic_reconfigure_options(
 #   cfg/DWAPlanner.cfg
#)



add_library(local_planner_lib src/my_local_planner_ros.cpp)

package.xml

<?xml version="1.0"?>
<package format="2">
  <name>my_local_planner</name>
  <version>0.0.0</version>
  <description>The my_local_planner package</description>

  <!-- One maintainer tag required, multiple allowed, one person per tag -->
  <!-- Example:  -->
  <!-- <maintainer email="jane.doe@example.com">Jane Doe</maintainer> -->
  <maintainer email="skpro19@todo.todo">skpro19</maintainer>


  <!-- One license tag required, multiple allowed, one license per tag -->
  <!-- Commonly used license strings: -->
  <!--   BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->
  <license>TODO</license>


  <!-- Url tags are optional, but multiple are allowed, one per tag -->
  <!-- Optional attribute type can be: website, bugtracker, or repository -->
  <!-- Example: -->
  <!-- <url type="website">http://wiki.ros.org/my_explore_lite</url> -->


  <!-- Author tags are optional, multiple are allowed, one per tag -->
  <!-- Authors do not have to be maintainers, but could be -->
  <!-- Example: -->
  <!-- <author email="jane.doe@example.com">Jane Doe</author> -->


  <!-- The *depend tags are used to specify dependencies -->
  <!-- Dependencies can be catkin packages or system dependencies -->
  <!-- Examples: -->
  <!-- Use depend as a shortcut for packages that are both build and exec dependencies -->
  <!--   <depend>roscpp</depend> -->
  <!--   Note that this is equivalent to the following: -->
  <!--   <build_depend>roscpp</build_depend> -->
  <!--   <exec_depend>roscpp</exec_depend> -->
  <!-- Use build_depend for packages you need at compile ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-07-13 21:51:01 -0600

fergs gravatar image

You can use c++filt to decode your missing symbol:

>> c++filt _ZN13local_planner12LocalPlannerD1Ev
local_planner::LocalPlanner::~LocalPlanner()

Looks like maybe you forgot to actually define your destructor?

edit flag offensive delete link more

Comments

Thanks. That solved the issue. Just curious, is there a reason that the error message is in such cyrptic form (a.k.a undefined symbol: _ZN13local_planner12LocalPlannerD1Ev)? Is there a way to see the error messages in not-so cryptic format by default?

skpro19 gravatar image skpro19  ( 2021-07-14 08:58:18 -0600 )edit
1

AFAIK, there is no way to automatically run c++filt during the build

fergs gravatar image fergs  ( 2021-07-25 11:28:16 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2021-07-13 17:11:16 -0600

Seen: 207 times

Last updated: Jul 13 '21