ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Failed to load nodelet

asked 2016-05-27 03:57:39 -0500

Megacephalo gravatar image

updated 2016-05-27 20:20:43 -0500

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) ;
edit retag flag offensive close merge delete

Comments

Could you also post your launch file?

Martin Peris gravatar image Martin Peris  ( 2016-05-27 05:13:09 -0500 )edit

Thank you @Martin Peris, I added the launch file.

Megacephalo gravatar image Megacephalo  ( 2016-05-27 20:21:16 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted
1

answered 2016-05-27 20:27:28 -0500

kmhallen gravatar image

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

<library path="lib/librange_proximity_safety_controller_nodelet">
edit flag offensive delete link more

Comments

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?

Megacephalo gravatar image Megacephalo  ( 2016-05-28 20:32:34 -0500 )edit
1

So what was the issue? How was this fixed?

tanasis gravatar image tanasis  ( 2017-06-08 06:48:56 -0500 )edit

@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.

130s gravatar image 130s  ( 2017-10-03 07:26:55 -0500 )edit
1

@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.

Hendrik Wiese gravatar image Hendrik Wiese  ( 2018-11-08 02:15:33 -0500 )edit
2

answered 2019-04-23 05:31:48 -0500

Germanunkol gravatar image

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".

edit flag offensive delete link more
0

answered 2020-05-13 23:04:47 -0500

mmiles19 gravatar image

updated 2022-10-05 16:47:56 -0500

lucasw gravatar image

I solved this by including the following in my package.xml:

<export> <nodelet plugin="${prefix}/nodelet_plugins.xml" /> </export>

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-05-27 03:57:39 -0500

Seen: 17,636 times

Last updated: Oct 05 '22