ros2 / ros2cli

ROS 2 command line interface tools
Apache License 2.0
173 stars 160 forks source link

support `verbose` option for `ros2 service info` #877

Open fujitatomoya opened 8 months ago

fujitatomoya commented 8 months ago

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

Ryanf55 commented 8 months ago

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
leeminju531 commented 7 months ago

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

Ryanf55 commented 7 months ago

It's all you! Help is much appreciated.

fujitatomoya commented 7 months ago

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