ros2cli icon indicating copy to clipboard operation
ros2cli copied to clipboard

support `verbose` option for `ros2 service info`

Open fujitatomoya opened this issue 1 year ago • 4 comments

Feature request

Feature description

ros2 service info is supported with https://github.com/ros2/ros2cli/pull/771.

root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 service info /add_two_ints
Type: example_interfaces/srv/AddTwoInts
Clients count: 0
Services count: 1

this new feature provides more detailed information for the service endpoint, similar with ros2 topic info -v.

root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 topic info -v /chatter
Type: std_msgs/msg/String

Publisher count: 1

Node name: talker
Node namespace: /
Topic type: std_msgs/msg/String
Topic type hash: RIHS01_df668c740482bbd48fb39d76a70dfd4bd59db1288021743503259e948f6b1a18
Endpoint type: PUBLISHER
GID: 01.0f.98.8a.17.fd.e4.3f.00.00.00.00.00.00.14.03
QoS profile:
  Reliability: RELIABLE
  History (Depth): UNKNOWN
  Durability: VOLATILE
  Lifespan: Infinite
  Deadline: Infinite
  Liveliness: AUTOMATIC
  Liveliness lease duration: Infinite

Subscription count: 0

Implementation considerations

  • RMW interface and implementation
    • rmw_get_clients_info_by_service and rmw_get_servers_info_by_service need to be supported. in rmw implementation, it can internally convert the service type into topic type based on the prefixes, and then call graph_cache interface for Reader and Writer endpoints.
  • rcl, rclcpp and rclpy
    • expose rmw interfaces accordingly to be called by application (ros2cli).
  • ros2_documentation needs to be update accordingly.

fujitatomoya avatar Jan 19 '24 18:01 fujitatomoya

Could we also somehow get it to print the unmangled topic type?

It's quite difficult to get this right when connecting ROS implementation to bare DDS, because

  1. It's hard to find documentation as the design doc never documented the decision; it only has the potential approaches
  2. ROS has changed behavior (removing dds_ at some release), so some posts about it are incorrect: https://github.com/ros2/rosidl/issues/706
  3. If the topic type doesn't match up, it's hard to realize it's wrong and there aren't always errors printed, especially if you forget to bind the callbacks in the bare DDS code.

For more reference, the interop I did with ArduPilot is here: https://github.com/ArduPilot/ardupilot/blob/fb26452b8db27bca2591968eae79c8f0d2b61c48/libraries/AP_DDS/README.md?plain=1#L341

And, the mangling can be seen here: https://github.com/ArduPilot/ardupilot/blob/fb26452b8db27bca2591968eae79c8f0d2b61c48/libraries/AP_DDS/dds_xrce_profile.xml#L275

The above is working with FastDDS on humble.

For example, for maximum detail, one could implement ros2 service info -v it to show:

$ ros2 service info ap/arm_motors

...
Request Topic Type (DDS): ardupilot_msgs::srv::dds_::ArmMotors_Request_
Request Topic Name (DDS): rq/ap/arm_motorsRequest

Response Topic Type (DDS): ardupilot_msgs::srv::dds_::ArmMotors_Response_
Response Topic Type (DDS): rr/ap/arm_motorsReply

Topic Type (ROS): ardupilot_msgs/srv/ArmMotors

Ryanf55 avatar Jan 19 '24 19:01 Ryanf55

who is progressing these? I am willing to take care of these if nobody else is working on them.

leeminju531 avatar Feb 29 '24 02:02 leeminju531

It's all you! Help is much appreciated.

Ryanf55 avatar Feb 29 '24 04:02 Ryanf55

Not directly related but https://github.com/ros2/rclcpp/pull/2406#issuecomment-1924589468 is worth to take a look.

fujitatomoya avatar Feb 29 '24 17:02 fujitatomoya