Unable to load plugins; ClassLoader error
I have created a plugin to test some changes that I will make in the exploration algorithm later. But, I am unable to load the plugins which I created. When I run my launch file, it calls for this plugin, but I get the following error:
[ERROR] [1446688037.439927809]: Failed to load exploration plugin! Error: MultiLibraryClassLoader: Could not create object of class type NearestBasedAllocation as no factory exists for it. Make sure that the library exists and was explicitly loaded through MultiLibraryClassLoader::loadLibrary()
In my package.xml, I am using export tag to link to frontier.xml
:
<export>
<nav2d_navigator plugin="${prefix}/frontier.xml" />
</export>
While in frontier.xml
, I am giving a brief explanation about my class
<library path="libFrontierPlugins">
<class name="NearestBasedAllocation" type="NearestBasedAllocation" base_class_type="ExplorationPlanner">
<description>
Performs simple, uncoordinated nearest-frontier exploration.
</description>
</class>
</library>
My CMakeLists.txt
file:
cmake_minimum_required(VERSION 2.8.3)
project(frontier_exploration)
find_package(catkin REQUIRED
COMPONENTS
geometry_msgs
nav2d_navigator
nav_msgs
pluginlib
roscpp
visualization_msgs
tf
std_msgs
)
catkin_package(LIBRARIES
ExplorationPlugins
CATKIN_DEPENDS
roscpp
tf
pluginlib
geometry_msgs
nav_msgs
visualization_msgs
nav2d_navigator
std_msgs
)
include_directories(include/${PROJECT_NAME}/${catkin_INCLUDE_DIRS})
add_library(FrontierPlugins src/NearestBasedAllocation.cpp)
add_dependencies(FrontierPlugins ${catkin_EXPORTED_TARGETS})
target_link_libraries(FrontierPlugins ${catkin_LIBRARIES})
install(TARGETS FrontierPlugins
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})
install(FILES frontier.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
Can anyone please help me with the reason why I am unable to load these plugins? Thanks