rclcpp_components
master
Package containing tools for dynamically loadable components
|
Go to the documentation of this file.
41 #ifndef RCLCPP_COMPONENTS__COMPONENT_MANAGER_HPP__
42 #define RCLCPP_COMPONENTS__COMPONENT_MANAGER_HPP__
50 #include "composition_interfaces/srv/load_node.hpp"
51 #include "composition_interfaces/srv/unload_node.hpp"
52 #include "composition_interfaces/srv/list_nodes.hpp"
81 using LoadNode = composition_interfaces::srv::LoadNode;
82 using UnloadNode = composition_interfaces::srv::UnloadNode;
83 using ListNodes = composition_interfaces::srv::ListNodes;
105 .start_parameter_services(
false)
106 .start_parameter_event_publisher(
false));
122 const std::string & resource_index =
"rclcpp_components")
const;
186 uint64_t unique_id_ {1};
197 #endif // RCLCPP_COMPONENTS__COMPONENT_MANAGER_HPP__
ComponentManager handles the services to load, unload, and get the list of loaded components.
Definition: component_manager.hpp:78
composition_interfaces::srv::ListNodes ListNodes
Definition: component_manager.hpp:83
#define RCLCPP_COMPONENTS_PUBLIC
Definition: visibility_control.hpp:50
Thrown when an error happens in the component Manager class.
Definition: component_manager.hpp:70
composition_interfaces::srv::UnloadNode UnloadNode
Definition: component_manager.hpp:82
composition_interfaces::srv::LoadNode LoadNode
Definition: component_manager.hpp:81
ComponentManager(std::weak_ptr< rclcpp::Executor > executor, std::string node_name="ComponentManager", const rclcpp::NodeOptions &node_options=rclcpp::NodeOptions() .start_parameter_services(false) .start_parameter_event_publisher(false))
Default constructor.
virtual std::shared_ptr< rclcpp_components::NodeFactory > create_component_factory(const ComponentResource &resource)
Instantiate a component from a dynamic library.
virtual void OnLoadNode(const std::shared_ptr< rmw_request_id_t > request_header, const std::shared_ptr< LoadNode::Request > request, std::shared_ptr< LoadNode::Response > response)
Service callback to load a new node in the component.
ComponentManagerException(const std::string &error_desc)
Definition: component_manager.hpp:73
virtual ~ComponentManager()
virtual void OnListNodes(const std::shared_ptr< rmw_request_id_t > request_header, const std::shared_ptr< ListNodes::Request > request, std::shared_ptr< ListNodes::Response > response)
Service callback to get the list of nodes in the component.
Definition: component_manager.hpp:66
virtual std::vector< ComponentResource > get_component_resources(const std::string &package_name, const std::string &resource_index="rclcpp_components") const
Return a list of valid loadable components in a given package.
virtual void OnUnloadNode(const std::shared_ptr< rmw_request_id_t > request_header, const std::shared_ptr< UnloadNode::Request > request, std::shared_ptr< UnloadNode::Response > response)
Service callback to unload a node in the component.