unable to integrate local planner plugin into move_base
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 ...