Custom Global Planner causing problems - undefined symbol
I just created a CopyPlanner as a custom Global Planner (following this tutorial) that copies a plan from elsewhere and passes it on to the local planner. Every time I try using it as part of my application I get the following error:
[ INFO] [1624971783.958384719]: global_costmap: Using plugin "static_layer"
[ INFO] [1624971783.967317766]: Requesting the map...
[ INFO] [1624971784.172037054]: Resizing costmap to 2505 X 1005 at 0.050000 m/pix
[ INFO] [1624971784.270623155]: Received a 2505 X 1005 map at 0.050000 m/pix
[ INFO] [1624971784.275646093]: global_costmap: Using plugin "obstacles_layer"
[ INFO] [1624971784.279385243]: Subscribed to Topics: scan scan2
[ INFO] [1624971784.320028943]: global_costmap: Using plugin "inflater_layer"
/opt/ros/melodic/lib/move_base/move_base: symbol lookup error: /home/jm/catkin_ws/devel/lib//libcopy_planner_lib.so: undefined symbol: _ZN18base_local_planner12CostmapModelC1ERKN10costmap_2d9Costmap2DE
[move_base-4] process has died [pid 8140, exit code 127, cmd /opt/ros/melodic/lib/move_base/move_base __name:=move_base __log:=/home/jm/.ros/log/4faf7662-d8da-11eb-90d3-046c59d9d94c/move_base-4.log].
log file: /home/jm/.ros/log/4faf7662-d8da-11eb-90d3-046c59d9d94c/move_base-4*.log
I have no idea what could be going wrong as I am still very new to ROS. I found someone having the same issue but I don't understand what was suggested in the solution.
Here is my CMakeLists.txt file:
cmake_minimum_required(VERSION 3.0.2)
project(isaac_navigation)
find_package(catkin REQUIRED
COMPONENTS
roscpp
rospy
std_msgs
pluginlib
geometry_msgs
nav_msgs
message_generation
base_local_planner
)
add_message_files(
FILES
path.msg
)
add_service_files(
FILES
copier.srv
)
generate_messages(
DEPENDENCIES
std_msgs
geometry_msgs
nav_msgs
)
catkin_package(
INCLUDE_DIRS include
LIBRARIES isaac_navigation
CATKIN_DEPENDS roscpp rospy std_msgs message_runtime nav_msgs geometry_msgs
)
include_directories(include
${catkin_INCLUDE_DIRS}
)
add_library(copy_planner_lib src/copy_planner.cpp)
Here is my package.xml file:
<?xml version="1.0"?>
<package format="2">
<name>isaac_navigation</name>
<version>0.0.0</version>
<description>The isaac_navigation package</description>
<maintainer email="somemail">J</maintainer>
<license>BSD</license>
<author email="somemail">J</author>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>roslaunch</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>rospy</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>geometry_msgs</build_depend>
<build_depend>nav_msgs</build_depend>
<build_depend>message_generation</build_depend>
<build_depend>nav_core</build_depend>
<build_export_depend>roscpp</build_export_depend>
<build_export_depend>rospy</build_export_depend>
<build_export_depend>std_msgs</build_export_depend>
<build_export_depend>nav_msgs</build_export_depend>
<build_export_depend>geometry_msgs</build_export_depend>
<exec_depend>roscpp</exec_depend>
<exec_depend>rospy</exec_depend>
<exec_depend>std_msgs</exec_depend>
<exec_depend>nav_msgs</exec_depend>
<exec_depend>geometry_msgs</exec_depend>
<exec_depend>map_server</exec_depend>
<exec_depend>move_base</exec_depend>
<exec_depend>message_runtime</exec_depend>
<exec_depend>nav_core</exec_depend>
<!-- The export tag contains other, unspecified, tags -->
<export>
<nav_core plugin="${prefix}/copy_planner_plugin.xml" />
</export>
</package>
Here is my copy_planner.xml file:
<library path="lib/libcopy_planner_lib">
<class name="copy_planner/CopyPlanner" type="copy_planner::CopyPlanner" base_class_type="nav_core::BaseGlobalPlanner">
<description>AAAAAAAAAAAAAAAAAAAAAAAAAAAAA</description>
</class>
</library>
Here is my move_base.launch file:
<launch>
<master auto="start"/>
<!-- Run the map server -->
<node name="map_server" pkg="map_server" type="map_server" args="/home/jm/isaac/sdk/packages/eband_ros/maps/factory.yaml"/>
<arg name="open_rviz" default="true"/>
<group if="$(arg open_rviz)">
<node pkg="rviz" type="rviz" name="rviz" required="true" args="-d $(find isaac_navigation)/rviz/nav.rviz"/>
</group>
<!-- Setting up costmap -->
<!-- <node name="static_tf0" pkg="tf" type="static_transform_publisher" args="2 0 0 0 0 0 /map /base_footprint 100"/> -->
<!-- move_base -->
<node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
<rosparam file="$(find isaac_navigation)/param/costmap_common_params.yaml" command="load" ns ...