diff --git a/rclcpp_components/include/rclcpp_components/component_manager.hpp b/rclcpp_components/include/rclcpp_components/component_manager.hpp index a29edbf4a6..b2f1de0827 100644 --- a/rclcpp_components/include/rclcpp_components/component_manager.hpp +++ b/rclcpp_components/include/rclcpp_components/component_manager.hpp @@ -109,7 +109,7 @@ class ComponentManager : public rclcpp::Node virtual ~ComponentManager(); /// Return a list of valid loadable components in a given package. - /* + /** * \param package_name name of the package * \param resource_index name of the executable * \throws ComponentManagerException if the resource was not found or a invalid resource entry @@ -122,7 +122,7 @@ class ComponentManager : public rclcpp::Node const std::string & resource_index = "rclcpp_components") const; /// Instantiate a component from a dynamic library. - /* + /** * \param resource a component resource (class name + library path) * \return a NodeFactory interface */ @@ -132,16 +132,16 @@ class ComponentManager : public rclcpp::Node protected: /// Create node options for loaded component - /* + /** * \param request information with the node to load * \return node options */ RCLCPP_COMPONENTS_PUBLIC virtual rclcpp::NodeOptions - CreateNodeOptions(const std::shared_ptr request); + create_node_options(const std::shared_ptr request); /// Service callback to load a new node in the component - /* + /** * This function allows to add parameters, remap rules, a specific node, name a namespace * and/or additional arguments. * @@ -155,13 +155,27 @@ class ComponentManager : public rclcpp::Node */ RCLCPP_COMPONENTS_PUBLIC virtual void - OnLoadNode( + on_load_node( const std::shared_ptr request_header, const std::shared_ptr request, std::shared_ptr response); + /** + * \deprecated Use on_load_node() instead + */ + [[deprecated("Use on_load_node() instead")]] + RCLCPP_COMPONENTS_PUBLIC + virtual void + OnLoadNode( + const std::shared_ptr request_header, + const std::shared_ptr request, + std::shared_ptr response) + { + on_load_node(request_header, request, response); + } + /// Service callback to unload a node in the component - /* + /** * \param request_header unused * \param request unique identifier to remove from the component * \param response true on the success field if the node unload was succefully, otherwise false @@ -169,13 +183,27 @@ class ComponentManager : public rclcpp::Node */ RCLCPP_COMPONENTS_PUBLIC virtual void - OnUnloadNode( + on_unload_node( const std::shared_ptr request_header, const std::shared_ptr request, std::shared_ptr response); + /** + * \deprecated Use on_unload_node() instead + */ + [[deprecated("Use on_unload_node() instead")]] + RCLCPP_COMPONENTS_PUBLIC + virtual void + OnUnloadNode( + const std::shared_ptr request_header, + const std::shared_ptr request, + std::shared_ptr response) + { + on_unload_node(request_header, request, response); + } + /// Service callback to get the list of nodes in the component - /* + /** * Return a two list: one with the unique identifiers and other with full name of the nodes. * * \param request_header unused @@ -184,11 +212,25 @@ class ComponentManager : public rclcpp::Node */ RCLCPP_COMPONENTS_PUBLIC virtual void - OnListNodes( + on_list_nodes( const std::shared_ptr request_header, const std::shared_ptr request, std::shared_ptr response); + /** + * \deprecated Use on_list_nodes() instead + */ + [[deprecated("Use on_list_nodes() instead")]] + RCLCPP_COMPONENTS_PUBLIC + virtual void + OnListNodes( + const std::shared_ptr request_header, + const std::shared_ptr request, + std::shared_ptr response) + { + on_list_nodes(request_header, request, response); + } + private: std::weak_ptr executor_; diff --git a/rclcpp_components/src/component_manager.cpp b/rclcpp_components/src/component_manager.cpp index e013dca479..cc2157f0d5 100644 --- a/rclcpp_components/src/component_manager.cpp +++ b/rclcpp_components/src/component_manager.cpp @@ -39,13 +39,13 @@ ComponentManager::ComponentManager( { loadNode_srv_ = create_service( "~/_container/load_node", - std::bind(&ComponentManager::OnLoadNode, this, _1, _2, _3)); + std::bind(&ComponentManager::on_load_node, this, _1, _2, _3)); unloadNode_srv_ = create_service( "~/_container/unload_node", - std::bind(&ComponentManager::OnUnloadNode, this, _1, _2, _3)); + std::bind(&ComponentManager::on_unload_node, this, _1, _2, _3)); listNodes_srv_ = create_service( "~/_container/list_nodes", - std::bind(&ComponentManager::OnListNodes, this, _1, _2, _3)); + std::bind(&ComponentManager::on_list_nodes, this, _1, _2, _3)); } ComponentManager::~ComponentManager() @@ -122,7 +122,7 @@ ComponentManager::create_component_factory(const ComponentResource & resource) } rclcpp::NodeOptions -ComponentManager::CreateNodeOptions(const std::shared_ptr request) +ComponentManager::create_node_options(const std::shared_ptr request) { std::vector parameters; for (const auto & p : request->parameters) { @@ -167,7 +167,7 @@ ComponentManager::CreateNodeOptions(const std::shared_ptr req } void -ComponentManager::OnLoadNode( +ComponentManager::on_load_node( const std::shared_ptr request_header, const std::shared_ptr request, std::shared_ptr response) @@ -187,7 +187,7 @@ ComponentManager::OnLoadNode( continue; } - auto options = CreateNodeOptions(request); + auto options = create_node_options(request); auto node_id = unique_id_++; if (0 == node_id) { @@ -237,7 +237,7 @@ ComponentManager::OnLoadNode( } void -ComponentManager::OnUnloadNode( +ComponentManager::on_unload_node( const std::shared_ptr request_header, const std::shared_ptr request, std::shared_ptr response) @@ -262,7 +262,7 @@ ComponentManager::OnUnloadNode( } void -ComponentManager::OnListNodes( +ComponentManager::on_list_nodes( const std::shared_ptr request_header, const std::shared_ptr request, std::shared_ptr response)