1919import rclpy
2020
2121
22- # https://github.com/ros2/ros2cli/blob/master /ros2param/ros2param/api/__init__.py#L174
23- def list_parameters (node ):
22+ # https://github.com/ros2/ros2cli/blob/780923c046f8e537e884d18bef33a2338f2d409c /ros2param/ros2param/api/__init__.py#L174
23+ def list_parameters (node , timeout_sec = 10.0 ):
2424 # create client
2525 client = node .create_client (
2626 ListParameters ,
2727 'consai2r2_description/list_parameters' )
2828
2929 # call as soon as ready
30- ready = client .wait_for_service (timeout_sec = 5.0 )
30+ ready = client .wait_for_service (timeout_sec )
3131 if not ready :
3232 raise RuntimeError ('Wait for service timed out' )
3333
@@ -43,15 +43,15 @@ def list_parameters(node):
4343 return response .result .names
4444
4545
46- # https://github.com/ros2/ros2cli/blob/master /ros2param/ros2param/api/__init__.py#L54
47- def get_parameters (node , parameter_names ):
46+ # https://github.com/ros2/ros2cli/blob/780923c046f8e537e884d18bef33a2338f2d409c /ros2param/ros2param/api/__init__.py#L122
47+ def get_parameters (node , parameter_names , timeout_sec = 10.0 ):
4848 # create client
4949 client = node .create_client (
5050 GetParameters ,
5151 'consai2r2_description/get_parameters' )
5252
5353 # call as soon as ready
54- ready = client .wait_for_service (timeout_sec = 5.0 )
54+ ready = client .wait_for_service (timeout_sec )
5555 if not ready :
5656 raise RuntimeError ('Wait for service timed out' )
5757
@@ -68,6 +68,7 @@ def get_parameters(node, parameter_names):
6868
6969 return_values = {}
7070
71+ # https://github.com/ros2/ros2cli/blob/780923c046f8e537e884d18bef33a2338f2d409c/ros2param/ros2param/api/__init__.py#L54
7172 for i , pvalue in enumerate (response .values ):
7273 if pvalue .type == ParameterType .PARAMETER_BOOL :
7374 value = pvalue .bool_value
0 commit comments