Class LoaderROS
Defined in File loader_ros.h
Class Documentation
-
class LoaderROS
ROS interface for loading/unloading nodelets (internally using nodelet::Loader to do the work).
Advertised services are:
load_nodelet (nodelet/NodeletLoad): Load a nodelet.
unload_nodelet (nodelet/NodeletUnload): Unload a nodelet.
list (nodelet/NodeletList): List the names of all currently loaded nodelets.
Public Functions
-
LoaderROS(::nodelet::Loader *parent, const ::ros::NodeHandle &nh)
Construct the ROS interface for the given loader.
- Parameters:
parent – [in] The loader to use for the actual nodelet loading/unloading.
nh – [in] The node handle to use for the advertised services.
Protected Types
-
typedef ::boost::ptr_map<::std::string, ::bond::Bond> M_stringToBond
Type of the map of nodelet name->bond.
Protected Functions
-
bool serviceLoad(::nodelet::NodeletLoad::Request &req, ::nodelet::NodeletLoad::Response &res)
Load a nodelet.
- Parameters:
req – [in] Parameters of the nodelet.
res – [out] Whether the loading succeeded.
- Returns:
res.success.
-
bool serviceUnload(::nodelet::NodeletUnload::Request &req, ::nodelet::NodeletUnload::Response &res)
Unload a nodelet.
- Parameters:
req – [in] Parameters of the nodelet.
res – [out] Whether the unloading succeeded.
- Returns:
res.success.
-
bool unload(const ::std::string &name)
Unload a nodelet of the given name.
- Parameters:
name – [in] Name of the nodelet to unload.
- Returns:
Whether the unloading succeeded.
-
bool serviceList(::nodelet::NodeletList::Request &req, ::nodelet::NodeletList::Response &res)
List all loaded nodelets.
- Parameters:
req – [in] Unused.
res – [out] The loaded nodelet names.
- Returns:
True.
Protected Attributes
-
::nodelet::Loader *parent_
The actual nodelet loader to use.
-
::ros::NodeHandle nh_
The node handle to use for the advertised services.
-
::ros::ServiceServer load_server_
Service server for load_nodelet service.
-
::ros::ServiceServer unload_server_
Service server for unload_nodelet service.
-
::ros::ServiceServer list_server_
Service server for list service.
-
::boost::mutex lock_
Lock protecting access to parent_ and bond_map_.
-
::ros::CallbackQueue bond_callback_queue_
Callback queue used for the created bonds.
-
::ros::AsyncSpinner bond_spinner_
Spinner of bond_callback_queue_.
-
M_stringToBond bond_map_
Map of nodelet name->bond.