Skip to content

Commit 227509a

Browse files
authored
fix deprecated warning for action graph APIs. (#1188)
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
1 parent 181a85c commit 227509a

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

ros2cli/ros2cli/daemon/__init__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@
1818
import uuid
1919

2020
import rclpy
21-
import rclpy.action
2221

2322
from ros2cli.helpers import before_invocation
24-
from ros2cli.helpers import bind
2523
from ros2cli.helpers import get_ros_domain_id
2624
from ros2cli.helpers import pretty_print_call
2725

@@ -85,7 +83,7 @@ def serve(server: LocalXMLRPCServer, *, timeout: int = 2 * 60 * 60):
8583
node.get_node_names_and_namespaces_with_enclaves,
8684
node.get_topic_names_and_types,
8785
node.get_service_names_and_types,
88-
bind(rclpy.action.get_action_names_and_types, node),
86+
node.get_action_names_and_types,
8987
node.get_publisher_names_and_types_by_node,
9088
node.get_publishers_info_by_topic,
9189
node.get_subscriber_names_and_types_by_node,
@@ -94,8 +92,8 @@ def serve(server: LocalXMLRPCServer, *, timeout: int = 2 * 60 * 60):
9492
node.get_servers_info_by_service,
9593
node.get_clients_info_by_service,
9694
node.get_client_names_and_types_by_node,
97-
bind(rclpy.action.get_action_server_names_and_types_by_node, node),
98-
bind(rclpy.action.get_action_client_names_and_types_by_node, node),
95+
node.get_action_server_names_and_types_by_node,
96+
node.get_action_client_names_and_types_by_node,
9997
node.count_publishers,
10098
node.count_subscribers,
10199
node.count_clients,

ros2cli/ros2cli/node/direct.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from typing import Optional
1717

1818
import rclpy
19-
import rclpy.action
2019

2120
from rclpy.parameter import Parameter
2221
from ros2cli.helpers import check_discovery_configuration
@@ -69,19 +68,16 @@ def timer_callback():
6968
def __enter__(self):
7069
return self
7170

72-
# TODO(hidmic): generalize/standardize rclpy graph API
73-
# to not have to make a special case for
74-
# rclpy.action
7571
def get_action_names_and_types(self) -> list[tuple[str, list[str]]]:
76-
return rclpy.action.get_action_names_and_types(self.node)
72+
return self.node.get_action_names_and_types()
7773

7874
def get_action_client_names_and_types_by_node(self, remote_node_name, remote_node_namespace):
79-
return rclpy.action.get_action_client_names_and_types_by_node(
80-
self.node, remote_node_name, remote_node_namespace)
75+
return self.node.get_action_client_names_and_types_by_node(
76+
remote_node_name, remote_node_namespace)
8177

8278
def get_action_server_names_and_types_by_node(self, remote_node_name, remote_node_namespace):
83-
return rclpy.action.get_action_server_names_and_types_by_node(
84-
self.node, remote_node_name, remote_node_namespace)
79+
return self.node.get_action_server_names_and_types_by_node(
80+
remote_node_name, remote_node_namespace)
8581

8682
def __getattr__(self, name):
8783
if not rclpy.ok():

0 commit comments

Comments
 (0)