My nodelet won't run
Hello,
I'm trying to build my own Controller with help of this page ( http://wiki.ros.org/kobuki/Tutorials/... ) which helps you create a nodelet.
Now have I tried a few things:
- Write my own, which looks like the 'random_walker' from git ( https://github.com/yujinrobot/kobuki/... )
- Copied the random_walker source and change all the names
- And tried to create it from the tutorial.
Every time I get stuck on the same point, when I want to launch my nodelet I get this error:
Failed to load nodelet [/drive_controller] of type [kobuki_autonome/DriveControllerNodelet] even after refreshing the cache: According to the loaded plugin descriptions the class kobuki_autonome/DriveControllerNodelet with base class type nodelet::Nodelet does not exist. Declared types are depth_image_proc/convert_metric depth_image_proc/crop_foremost depth_image_proc/disparity depth_image_proc/point_cloud_xyz depth_image_proc/point_cloud_xyz_radial depth_image_proc/point_cloud_xyzi depth_image_proc/point_cloud_xyzi_radial depth_image_proc/point_cloud_xyzrgb depth_image_proc/register image_proc/crop_decimate image_proc/crop_nonZero image_proc/crop_non_zero image_proc/debayer image_proc/rectify image_proc/resize image_publisher/image_publisher image_rotate/image_rotate image_view/disparity image_view/image kobuki_auto_docking/AutoDockingNodelet kobuki_bumper2pc/Bumper2PcNodelet kobuki_controller_tutorial/BumpBlinkControllerNodelet kobuki_node/KobukiNodelet kobuki_random_walker/RandomWalkerControllerNodelet kobuki_safety_controller/SafetyControllerNodelet nodelet_tutorial_math/Plus pcl/BAGReader pcl/BoundaryEstimation pcl/ConvexHull2D pcl/CropBox pcl/EuclideanClusterExtraction pcl/ExtractIndices pcl/ExtractPolygonalPrismData pcl/FPFHEstimation pcl/FPFHEstimationOMP pcl/MomentInvariantsEstimation pcl/MovingLeastSquares pcl/NodeletDEMUX pcl/NodeletMUX pcl/NormalEstimation pcl/NormalEstimationOMP pcl/NormalEstimationTBB pcl/PCDReader pcl/PCDWriter pcl/PFHEstimation pcl/PassThrough pcl/PointCloudConcatenateDataSynchronizer pcl/PointCloudConcatenateFieldsSynchronizer pcl/PrincipalCurvaturesEstimation pcl/ProjectInliers pcl/RadiusOutlierRemoval pcl/SACSegmentation pcl/SACSegmentationFromNormals pcl/SHOTEstimation pcl/SHOTEstimationOMP pcl/SegmentDifferences pcl/StatisticalOutlierRemoval pcl/VFHEstimation pcl/VoxelGrid stereo_image_proc/disparity stereo_image_proc/point_cloud2 yocs_cmd_vel_mux/CmdVelMuxNodelet yocs_velocity_smoother/VelocitySmootherNodelet
And I can't solve this. I have read about a mistaken path in the 'nodelet_plugins.xml', but that is not the case:
<library path="lib/libdrive_controller_nodelet">
<class name="kobuki_autonome/DriveControllerNodelet" type="kobuki::DriveControllerNodelet" base_class_type="nodelet::Nodelet">
<description>
Nodelet for a simple blink when bump controller
</description>
</class>
</library>
So can somebody help me?
Platform: Kobuki Kinetic
Updated: Added the code from pastebin into my post
CMakeLists:
cmake_minimum_required(VERSION 2.8.3)
project(kobuki_autonome)
find_package(catkin REQUIRED COMPONENTS roscpp
nodelet
pluginlib
std_msgs
kobuki_msgs
yocs_controllers)
catkin_package(INCLUDE_DIRS include
LIBRARIES drive_controller_nodelet
CATKIN_DEPENDS roscpp
nodelet
pluginlib
std_msgs
kobuki_msgs
yocs_controllers)
include_directories(include
${catkin_INCLUDE_DIRS})
add_library(drive_controller_nodelet src/nodelet.cpp)
add_dependencies(drive_controller_nodelet ${catkin_EXPORTED_TARGETS})
target_link_libraries(drive_controller_nodelet ${catkin_LIBRARIES})
install(TARGETS drive_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})
install(DIRECTORY launch
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
plugins/nodelet_plugins.xml:
<library path="lib/libdrive_controller_nodelet">
<class name="kobuki_autonome/DriveControllerNodelet" type="kobuki::DriveControllerNodelet" base_class_type="nodelet::Nodelet">
<description>
Nodelet test
</description>
</class>
</library>
src/nodelet.cpp:
#include <nodelet/nodelet.h>
#include <pluginlib/class_list_macros.h>
#include "kobuki_autonome/drive_controller.hpp"
namespace kobuki
{
/**
* @brief Nodelet-wrapper of the BumpBlinkController class
*/
class DriveControllerNodelet : public nodelet::Nodelet
{
public:
DriveControllerNodelet(){};
~DriveControllerNodelet(){}
/**
* @brief Initialise the nodelet
*
* This function is called, when the nodelet manager loads the nodelet.
*/
virtual void onInit()
{
ros::NodeHandle nh = this->getPrivateNodeHandle();
// resolve node(let) name
std::string name = nh.getUnresolvedNamespace();
int pos = name.find_last_of('/');
name = name.substr(pos + 1);
NODELET_INFO_STREAM("Initialising nodelet... [" << name << "]");
controller_.reset(new DriveController(nh, name));
// Initialises the controller
if (controller_->init())
{
NODELET_INFO_STREAM("Nodelet initialised. [" << name << "]");
}
else
{
NODELET_ERROR_STREAM("Couldn't initialise nodelet! Please ...