Ask Your Question
0

Nodelet is not recognized as a plugin

asked 2013-06-14 08:23:05 -0600

kaoao gravatar image

updated 2013-11-14 11:15:35 -0600

tfoote gravatar image

I tried to do the plugin tutorial, but rospack plugin --attrib didn't recognize my plugin. So I decided to move on to nodelets with plugins and I get the same problem. Here is my nodelet class:

#include <pluginlib/class_list_macros.h>
#include <nodelet/nodelet.h>
#include <ros/ros.h>

namespace nodeletnamespace {

    class mynodelet : public nodelet::Nodelet {
        public:
            virtual void onInit();
    };

    void mynodelet::onInit() {
        ROS_INFO("[%s] initialized.", getName().c_str());
    }
}    

PLUGINLIB_EXPORT_CLASS(nodeletnamespace::mynodelet, nodelet::Nodelet)

Here is mynodelet.xml:

<library path="lib/libmynodelet">
    <class name="nodelet_test/mynodelet"
        base_class_type ="nodelet::Nodelet"
        type="nodeletnamespace::mynodelet">
    <description>My Nodelet class </description>
    </class>
</library>

Here is the package.xml

<?xml version="1.0"?>
<package>
  <name>nodelet_test</name>
  <version>0.0.0</version>
  <description>The nodelet_test package</description>

  <maintainer email="jzt0011@auburn.edu">jt</maintainer>

  <license>TODO</license>

  <buildtool_depend>catkin</buildtool_depend>
  <build_depend>roscpp</build_depend>
  <build_depend>nodelet</build_depend>
  <run_depend>roscpp</run_depend>
  <run_depend>nodelet</run_depend>


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

and here is the Cmakelists.txt:

cmake_minimum_required(VERSION 2.8.3)
project(nodelet_test)

find_package(catkin REQUIRED COMPONENTS nodelet roscpp)

catkin_package(
   INCLUDE_DIRS include
   LIBRARIES nodelet_test
   CATKIN_DEPENDS nodelet roscpp
#  DEPENDS system_lib
)

include_directories(include
  ${catkin_INCLUDE_DIRS}
)

add_library(lib_mynodelete src/mynodelet.cpp)

any help is appreciated!

Here is the error I get: rosrun nodelet nodelet standalone /nodelet_test/nodeletnamespace __name:=bro type is /nodelet_test/nodeletnamespace

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-06-26 16:59:27 -0600

bit-pirate gravatar image

updated 2013-06-26 17:03:29 -0600

First, please add the full error message and put it in the right formatting.

Here are a few things I noticed in your problem description:

Does your library build at all? I see the missing dependency on pluginlib.

I see a spelling mistake in your CMakeLists.txt: add_library(lib_mynodelete src/mynodelet.cpp)

Finally, please make sure that the below really points to your xml file.

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

Hope this helps!

PS: This is the command, which lists all the available nodelet plugins:

rospack plugins --attrib=plugin nodelet

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-06-14 08:23:05 -0600

Seen: 1,607 times

Last updated: Jun 26 '13