ros2 / ros2cli

ROS 2 command line interface tools
Apache License 2.0
183 stars 165 forks source link

`ros2 service call` waits forever if QoS is incompatible with concerned server #818

Open fujitatomoya opened 1 year ago

fujitatomoya commented 1 year ago

Bug report

Required Info:

Steps to reproduce issue

        self.srv = self.create_service(
            AddTwoInts, 'my_add_two_ints', self.add_two_ints_callback, qos_profile=qos_profile_sensor_data)
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 service list
/my_add_two_ints
/parameter_blackboard/describe_parameters
/parameter_blackboard/get_parameter_types
/parameter_blackboard/get_parameters
/parameter_blackboard/list_parameters
/parameter_blackboard/set_parameters
/parameter_blackboard/set_parameters_atomically
/service_provider/describe_parameters
/service_provider/get_parameter_types
/service_provider/get_parameters
/service_provider/list_parameters
/service_provider/set_parameters
/service_provider/set_parameters_atomically
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 service call /my_add_two_ints example_interfaces/srv/AddTwoInts "a: 1
b: 2"
waiting for service to become available...
...

This does not work because internally incompatible QoS setting are detected in rmw, so that hidden topics construct services will not be able to communicate each other.

Expected behavior

Actual behavior

Additional information

In addition to this fundamental argument extension, it requires that user needs to be able to know what QoS setting is set on the service. So that user can set the appropriate QoS parameter to ros2 service call, but there is no such interface like get_servers_info_by_service nor get_clients_info_by_service. this could be considered as new feature and interfaces. besides, incompatible events are implemented on publisher and subscription, not for services or clients. that said, there will be not incompatible events for QoS with services.

fujitatomoya commented 1 year ago

related to https://github.com/ros2/ros2cli/pull/812