Fixing Nodelet does not exist errors in ROS
Published in Ros
This error is caused by the fact that ROS does not know about the nodelet. To be sure we can check what nodelets ROS knows about by running:
$ rosrun nodelet declared_nodelets
If the nodelet you are trying to run is not listed in the output then we have confirmed that ROS does not know about it. If you are trying to run a nodelet from another package this usually means that the package itself is not in your ROS_PACKAGE_PATH. This can happen if, for example, the package is not correctly installed.
If you are seeing this error for a nodelet that you wrote some possible reasons are:
- In the package declaring your nodelets the exports block does not link to your nodelet_plugin.xml
- Your package.xml does not list nodelet as a dependency
If the nodelet is listed in the declared_nodelets but still cannot be launched some possible reason are:
- The class name specified in the nodelet_plugins.xml file does not match the name of the class implementing the nodelet. This usually happens to me when I forget which namespace the nodelet is in.
- You forgot to add the 'PLUGINLIB_EXPORT_CLASS macro to the .cpp file
- Even dumber, you forgot to add the implementation of the nodelet to your CMakeLists.txt file