0
$\begingroup$

Rosanswers logo

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) ;

 

Originally posted by Megacephalo on ROS Answers with karma: 106 on 2016-05-27

Post score: 0


Original comments

Comment by Martin Peris on 2016-05-27:
Could you also post your launch file?

Comment by Megacephalo on 2016-05-27:
Thank you @Martin Peris, I added the launch file.

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

The nodelet_plugins.xml library path doesn't match your CMakeLists.txt library name.

<library path="lib/librange_proximity_safety_controller_nodelet"> 

Originally posted by kmhallen with karma: 1416 on 2016-05-27

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Megacephalo on 2016-05-28:
Thank you for responding, @kmhallen. I switched the library name as you have given then deleted build and devel file under my workspace and recompiled. but the error still persists. What could be the other reason?

Comment by tanasis on 2017-06-08:
So what was the issue? How was this fixed?

Comment by 130s on 2017-10-03:
@tanasis You should open a new question; Besides the comment section is not meant for new questions, questions asked in the comment section won't get as much attention.

Comment by Hendrik Wiese on 2018-11-08:
@130s it's not a new question. They're just asking for the actual solution because according to the first comment this answer does not seem to be it.

$\endgroup$
0
$\begingroup$

Rosanswers logo

The same error happens when your package.xml is missing the line:

<exec_depend>nodelet</exec_depend>

I wanted to add this as another answer (even if it does not precisely solve the question at hand - the OP had this line in his code), since this question is the first hit when searching for "Failed to load nodelet".


Originally posted by Germanunkol with karma: 31 on 2019-04-23

This answer was NOT ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.