From 0744d1c259bd88dd6e6b44428604e247ecc31619 Mon Sep 17 00:00:00 2001 From: FlorianLebecque Date: Tue, 14 Jan 2025 15:44:46 +0100 Subject: [PATCH] Add namespace to services names --- rosapi/scripts/rosapi_node | 59 ++++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/rosapi/scripts/rosapi_node b/rosapi/scripts/rosapi_node index 013b0729..93ae8385 100755 --- a/rosapi/scripts/rosapi_node +++ b/rosapi/scripts/rosapi_node @@ -89,47 +89,56 @@ class Rosapi(Node): else: full_name = self.get_namespace() + "/" + self.get_name() params.init(full_name) - self.create_service(Topics, "/rosapi/topics", self.get_topics) - self.create_service(Interfaces, "/rosapi/interfaces", self.get_interfaces) - self.create_service(TopicsForType, "/rosapi/topics_for_type", self.get_topics_for_type) + + self.create_service(Topics, full_name + "/topics", self.get_topics) + self.create_service(Interfaces, full_name + "/interfaces", self.get_interfaces) + self.create_service(TopicsForType, full_name + "/topics_for_type", self.get_topics_for_type) self.create_service( TopicsAndRawTypes, - "/rosapi/topics_and_raw_types", + full_name + "/topics_and_raw_types", self.get_topics_and_raw_types, ) - self.create_service(Services, "/rosapi/services", self.get_services) + self.create_service(Services, full_name + "/services", self.get_services) + self.create_service( + ServicesForType, + full_name + "/services_for_type", + self.get_services_for_type, + ) + self.create_service(Nodes, full_name + "/nodes", self.get_nodes) + self.create_service(NodeDetails, full_name + "/node_details", self.get_node_details) + self.create_service( + GetActionServers, full_name + "/action_servers", self.get_action_servers + ) + self.create_service(TopicType, full_name + "/topic_type", self.get_topic_type) + self.create_service(ServiceType, full_name + "/service_type", self.get_service_type) + self.create_service(Publishers, full_name + "/publishers", self.get_publishers) + self.create_service(Subscribers, full_name + "/subscribers", self.get_subscribers) self.create_service( - ServicesForType, "/rosapi/services_for_type", self.get_services_for_type + ServiceProviders, + full_name + "/service_providers", + self.get_service_providers, ) - self.create_service(Nodes, "/rosapi/nodes", self.get_nodes) - self.create_service(NodeDetails, "/rosapi/node_details", self.get_node_details) - self.create_service(GetActionServers, "/rosapi/action_servers", self.get_action_servers) - self.create_service(TopicType, "/rosapi/topic_type", self.get_topic_type) - self.create_service(ServiceType, "/rosapi/service_type", self.get_service_type) - self.create_service(Publishers, "/rosapi/publishers", self.get_publishers) - self.create_service(Subscribers, "/rosapi/subscribers", self.get_subscribers) + self.create_service(ServiceNode, full_name + "/service_node", self.get_service_node) self.create_service( - ServiceProviders, "/rosapi/service_providers", self.get_service_providers + MessageDetails, full_name + "/message_details", self.get_message_details ) - self.create_service(ServiceNode, "/rosapi/service_node", self.get_service_node) - self.create_service(MessageDetails, "/rosapi/message_details", self.get_message_details) self.create_service( ServiceRequestDetails, - "/rosapi/service_request_details", + full_name + "/service_request_details", self.get_service_request_details, ) self.create_service( ServiceResponseDetails, - "/rosapi/service_response_details", + full_name + "/service_response_details", self.get_service_response_details, ) - self.create_service(SetParam, "/rosapi/set_param", self.set_param) - self.create_service(GetParam, "/rosapi/get_param", self.get_param) - self.create_service(HasParam, "/rosapi/has_param", self.has_param) - self.create_service(DeleteParam, "/rosapi/delete_param", self.delete_param) - self.create_service(GetParamNames, "/rosapi/get_param_names", self.get_param_names) - self.create_service(GetTime, "/rosapi/get_time", self.get_time) - self.create_service(GetROSVersion, "/rosapi/get_ros_version", self.get_ros_version) + self.create_service(SetParam, full_name + "/set_param", self.set_param) + self.create_service(GetParam, full_name + "/get_param", self.get_param) + self.create_service(HasParam, full_name + "/has_param", self.has_param) + self.create_service(DeleteParam, full_name + "/delete_param", self.delete_param) + self.create_service(GetParamNames, full_name + "/get_param_names", self.get_param_names) + self.create_service(GetTime, full_name + "/get_time", self.get_time) + self.create_service(GetROSVersion, full_name + "/get_ros_version", self.get_ros_version) def get_globs(self): return glob_helper.get_globs(self)