Skip to content

Commit f3baaf2

Browse files
authored
fix: Support remapping service names (#1041)
1 parent 279f8dd commit f3baaf2

File tree

1 file changed

+3
-4
lines changed
  • rosbridge_library/src/rosbridge_library/internal

1 file changed

+3
-4
lines changed

rosbridge_library/src/rosbridge_library/internal/services.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
from typing import TYPE_CHECKING, Any, Callable, Optional
3535

3636
from rclpy.callback_groups import ReentrantCallbackGroup
37-
from rclpy.expand_topic_name import expand_topic_name
3837
from rclpy.node import Node
3938
from rosbridge_library.internal.message_conversion import (
4039
extract_values,
@@ -129,10 +128,10 @@ def call_service(
129128
server_ready_timeout: float = 1.0,
130129
server_response_timeout: float = 5.0,
131130
) -> dict:
132-
# Given the service name, fetch the type and class of the service,
133-
# and a request instance
134-
service = expand_topic_name(service, node_handle.get_name(), node_handle.get_namespace())
131+
# Get the fully qualified service name with remappings applied
132+
service = node_handle.resolve_service_name(service)
135133

134+
# Given the service name, fetch the type and class of the service, and a request instance
136135
service_names_and_types = dict(node_handle.get_service_names_and_types())
137136
service_types = service_names_and_types.get(service)
138137
if service_types is None:

0 commit comments

Comments
 (0)