nodelet_manager.h
Go to the documentation of this file.
1 #pragma once
2 
11 #include <memory>
12 #include <string>
13 
14 #include <boost/shared_ptr.hpp>
15 
16 #include <nodelet/loader.h>
17 #include <nodelet/nodelet.h>
18 #include <pluginlib/class_loader.h>
19 #include <ros/node_handle.h>
20 
22 
23 namespace cras
24 {
25 
32 {
33 public:
38  explicit NodeletManager(::ros::NodeHandle nh = {"~"});
39 
43  virtual void init();
44 
45 protected:
51  virtual ::boost::shared_ptr<::nodelet::Nodelet> createInstance(const ::std::string& lookupName);
52 
54  typedef ::pluginlib::ClassLoader<::nodelet::Nodelet> ClassLoader;
55 
57  ::std::unique_ptr<ClassLoader> classLoader;
58 
59  // loader has to be declared after classLoader, otherwise we get class_loader SEVERE_WARNING
60  // about leaving managed instances in memory
62  ::std::unique_ptr<::nodelet::Loader> loader;
63 
65  ::std::unique_ptr<::cras::LoaderROS> loaderRos;
66 
69 };
70 
71 }
::std::unique_ptr< ClassLoader > classLoader
Class loader used for loading nodelets.
NodeletManager(::ros::NodeHandle nh={"~"})
Create the nodelet manager.
virtual ::boost::shared_ptr<::nodelet::Nodelet > createInstance(const ::std::string &lookupName)
Create an instance of the given type.
virtual void init()
Initialize all class members.
::pluginlib::ClassLoader<::nodelet::Nodelet > ClassLoader
Type of the class loader used for loading nodelets.
::ros::NodeHandle nh
Node handle for the ROS API services.
::std::unique_ptr<::cras::LoaderROS > loaderRos
ROS API for the nodelet manager.
Definition: any.hpp:15
Nodelet manager with customizable instance creation mechanism.
::std::unique_ptr<::nodelet::Loader > loader
Nodelet loader that loads and runs the nodelets.


cras_cpp_common
Author(s): Martin Pecka
autogenerated on Sat Jun 17 2023 02:32:53