Failed to load nodelet
Hi all,
I have been developing a nodelet of my own making reference to kobuki project's safety controller package, however after I have successfully compiled my own package, I get the following error after launching my standalone nodelet manager and load in nodelet. I triple check if I have missed something but couldn't find anything wrong. I need a hand on how to compile a nodelet, HELP !
[ERROR] [1464333474.006836598]: Failed to load nodelet [/beebot_safety_controller] of type [beebot_safety_controller/SafetyControllerNodelet] even after refreshing the cache: According to the loaded plugin descriptions the class beebot_safety_controller/SafetyControllerNodelet with base class type nodelet::Nodelet does not exist.
I filtered the rest of the irrelevant infos. And here are the essential backbone files of my package: Launch file:
<launch>
<node pkg="nodelet" type="nodelet" name="nodelet_manager" args="manager" />
<node pkg="nodelet" type="nodelet" name="beebot_safety_controller"
args="load beebot_safety_controller/SafetyControllerNodelet nodelet_manager">
</node>
</launch>
CMakeLists.txt:
cmake_minimum_required(VERSION 2.8.3)
project(range_proximity_safety_controller)
find_package(catkin REQUIRED COMPONENTS
nodelet
pluginlib
geometry_msgs
roscpp
rospy
std_msgs
)
catkin_package(
INCLUDE_DIRS include
LIBRARIES range_proximity_safety_controller_nodelet
CATKIN_DEPENDS nodelet roscpp rospy std_msgs pluginlib geometry_msgs
)
include_directories(include
${catkin_INCLUDE_DIRS}
)
add_library(range_proximity_safety_controller_nodelet
src/safety_controller.cpp
)
add_dependencies(range_proximity_safety_controller_nodelet
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(range_proximity_safety_controller_nodelet
${catkin_LIBRARIES}
)
install(TARGETS range_proximity_safety_controller_nodelet
DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
)
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)
install(DIRECTORY plugins
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
package.xml:
<?xml version="1.0"?>
<package>
<name>range_proximity_safety_controller</name>
<version>0.0.0</version>
<description>The range_proximity_safety_controller package</description>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>nodelet</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>rospy</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>pluginlib</build_depend>
<build_depend>geometry_msgs</build_depend>
<run_depend>nodelet</run_depend>
<run_depend>roscpp</run_depend>
<run_depend>rospy</run_depend>
<run_depend>std_msgs</run_depend>
<run_depend>pluginlib</run_depend>
<run_depend>geometry_msgs</run_depend>
<export>
<nodelet pluginlib="${prefix}/plugins/nodelet_plugins.xml" />
</export>
</package>
plugins/nodelet_plugins.xml:
<library path="lib/libbeebot_safety_controller_nodelet">
<class name="beebot_safety_controller/SafetyControllerNodelet"
type="beebot::SafetyControllerNodelet"
base_class_type="nodelet::Nodelet">
<description>
Nodelet for Beebot's safety controller
</description>
</class>
</library>
the header file:
#ifndef _SAFETY_CONTROLLER_H_
#define _SAFETY_CONTROLLER_H_
#include <string>
#include <boost/concept_check.hpp>
#include <boost/graph/graph_concepts.hpp>
#include <ros/ros.h>
#include <std_msgs/Empty.h>
#include <geometry_msgs/Twist.h>
#include <sensor_msgs/LaserScan.h>
#include <stdio.h>
namespace beebot
{
class SafetyController
{
public:
// some stuff
private:
//other stuff
} ; // Class definition
} // namespace
#endif
the cpp file:
#include <nodelet/nodelet.h>
#include <pluginlib/class_list_macros.h>
#include "range_proximity_safety_controller/safety_controller.h"
namespace beebot{
class SafetyControllerNodelet : public nodelet::Nodelet
{
public:
// some stuff
private:
// other stuff
} ; // class
} // namespace
PLUGINLIB_EXPORT_CLASS(beebot::SafetyControllerNodelet, nodelet::Nodelet) ;
Could you also post your launch file?
Thank you @Martin Peris, I added the launch file.