RobotWebTools / rclnodejs

Node.js version of ROS 2.0 client
https://docs.ros.org/en/humble/Concepts/Basic/About-Client-Libraries.html?highlight=rclnodejs#community-maintained
Apache License 2.0
311 stars 70 forks source link

service introspection implementation #914

Closed wayneparrott closed 10 months ago

wayneparrott commented 1 year ago

The upcoming ROS 2 iron release introduces a nice debug feature for observing the flow of messages between a client and service. REP-2012 describes this feature known as Service Introspection. See #905 for additional links to other resources such as rcl.

You can use the ros2cli to observe service events when configured for either a server or client:
example: `ros2 topic echo /add_two_ints/_service_event

Also note that the service event msg definitions are created implicitly in the idl processing flow. Thus there is no explicit _Event.msg definition for the rclnodejs message generation process to work with. Thus, the message-generation process was modified to generate service event message interface, e.g., example_interfacessrvAddTwoInts_Event.js

Key changes include:

rcl_bindings.cpp *add ConfigureServiceIntrospection()

service.js and client.js

message generation

tsd generation

Fix #905

minggangw commented 1 year ago

@wayneparrott thanks for the quick action to catch up on the changes from rolling, as this is a pretty big PR, I may take some time to review it, thanks for your contribution!

minggangw commented 10 months ago

Hi @wayneparrott I'd like to merge this PR in advance, and I will make my commit based on yours, thanks!