Skip to content

Commit 7cb7d71

Browse files
committed
add skeleton for of service for registration of reference interfaces
1 parent eebc602 commit 7cb7d71

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed

controller_manager/include/controller_manager/controller_manager.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "controller_manager_msgs/srv/list_hardware_interfaces.hpp"
3737
#include "controller_manager_msgs/srv/load_controller.hpp"
3838
#include "controller_manager_msgs/srv/register_sub_controller_manager.hpp"
39+
#include "controller_manager_msgs/srv/register_sub_controller_manager_references.hpp"
3940
#include "controller_manager_msgs/srv/reload_controller_libraries.hpp"
4041
#include "controller_manager_msgs/srv/set_hardware_component_state.hpp"
4142
#include "controller_manager_msgs/srv/switch_controller.hpp"
@@ -586,6 +587,8 @@ class ControllerManager : public rclcpp::Node
586587
std::mutex central_controller_manager_srv_lock_;
587588
rclcpp::Service<controller_manager_msgs::srv::RegisterSubControllerManager>::SharedPtr
588589
register_sub_controller_manager_srv_;
590+
rclcpp::Service<controller_manager_msgs::srv::RegisterSubControllerManagerReferences>::SharedPtr
591+
register_sub_controller_manager_references_srv_;
589592

590593
std::vector<std::string> activate_request_, deactivate_request_;
591594
std::vector<std::string> to_chained_mode_request_, from_chained_mode_request_;

controller_manager/src/controller_manager.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,14 @@ void ControllerManager::init_distributed_central_controller_manager_services()
556556
&ControllerManager::register_sub_controller_manager_srv_cb, this, std::placeholders::_1,
557557
std::placeholders::_2),
558558
qos_profile_services_keep_all, distributed_system_srv_callback_group_);
559+
560+
register_sub_controller_manager_references_srv_ =
561+
create_service<controller_manager_msgs::srv::RegisterSubControllerManagerReferences>(
562+
"register_sub_controller_manager_references",
563+
std::bind(
564+
&ControllerManager::register_sub_controller_manager_references_srv_cb, this,
565+
std::placeholders::_1, std::placeholders::_2),
566+
qos_profile_services_keep_all, distributed_system_srv_callback_group_);
559567
}
560568

561569
void ControllerManager::register_sub_controller_manager_srv_cb(

controller_manager_msgs/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ set(srv_files
2222
srv/ListHardwareInterfaces.srv
2323
srv/LoadController.srv
2424
srv/RegisterSubControllerManager.srv
25+
srv/RegisterSubControllerManagerReferences.srv
2526
srv/ReloadControllerLibraries.srv
2627
srv/SetHardwareComponentState.srv
2728
srv/SwitchController.srv
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# The RegisterSubControllerManagerReferences service allows a distributed controller
2+
# manager to register it's reference interfaces at the central controller manager
3+
4+
# Req:
5+
# To register a controller the distributed sub controller manager has to
6+
# define:
7+
# * the full namespace it operates in
8+
# * all statePublishers the sub controller provides
9+
10+
# Res:
11+
# The response includes:
12+
# * a bool if the registration succeeded
13+
14+
string sub_controller_manager_namespace
15+
string sub_controller_manager_name
16+
controller_manager_msgs/PublisherDescription[] command_state_publishers
17+
---
18+
controller_manager_msgs/PublisherDescription[] command_state_publishers
19+
bool ok

0 commit comments

Comments
 (0)