This file contains a set of classes that make work with nodelets easier. More...
#include <nodelet/nodelet.h>
#include "nodelet_utils/log_macros.h"
#include "nodelet_utils/param_helper.hpp"
#include "nodelet_utils/nodelet_aware_tf_buffer.h"
#include "nodelet_utils/nodelet_with_diagnostics.hpp"
#include "nodelet_utils/nodelet_with_shared_tf_buffer.hpp"
#include "nodelet_utils/stateful_nodelet.hpp"
#include "nodelet_utils/thread_name_updating_nodelet.hpp"
Go to the source code of this file.
Classes | |
class | cras::Nodelet |
class | cras::NodeletBase< BaseNodelet > |
Base template which adds all defined mixins to BaseNodelet class. More... | |
Namespaces | |
cras | |
This file contains a set of classes that make work with nodelets easier.
There are a few helper "mixins":
NodeletParamHelper provides the conveniently templatized getParam() methods similar to those in node_utils.
StatefulNodelet adds state to the nodelets, so that you can query isOk() to determine whether the nodelet is not shutting down.
ThreadNameUpdatingNodelet adds function setThreadName() which you can call in your callbacks to signal to the OS which nodelet is currently being run in the particular nodelet manager's thread.
The NodeletSharingTfBuffer adds functions setBuffer(), getBuffer() and usesSharedBuffer(), which allow the nodelet manager to pass a pointer to a shared TF buffer. Note that standard nodelet manager cannot make use of this feature, so to utilize it, you should launch nodelet_manager_sharing_tf_buffer from this package instead.
Finally, NodeletBase<BaseNodelet> template class adds all these mixins to the provided BaseNodelet class to create a nodelet where you can use all the features added by the mentioned mixins. Use this template if you need to derive your nodelet from a different class than nodelet::Nodelet (like PCLNodelet).
If you just want to build your nodelet from scratch, you should start by deriving it from the cras::Nodelet class which has all the mixins and is based on nodelet::Nodelet.
Here's an example how your custom nodelet class should be started:
class MyClass : public cras\:\:Nodelet { ... }
In case you need to base your class on something else than nodelet::Nodelet, here's an example with a PCLNodelet:
class MyClass : public cras\:\:NodeletBase<pcl_ros\:\:PCLNodelet> { ... }
NodeletAwareTFBuffer is a class that is able to correctly end canTransform() calls in case the nodelet is asked to unload while the canTransform() call is waiting.
Definition in file nodelet_utils.hpp.