Add tutorial for service introspection#1266
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive documentation for service introspection functionality in rclnodejs. The tutorial covers how to use ROS 2's service introspection feature to monitor and debug service interactions by observing real-time request/response data.
- Introduces service introspection concepts and capabilities for monitoring ROS 2 service calls
- Provides detailed examples showing different introspection states (OFF, METADATA, CONTENTS) and their use cases
- Includes advanced usage patterns like performance analysis and best practices for production deployment
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| if (isServiceIntrospectionSupported()) { | ||
| service.configureIntrospection( | ||
| node.getClock(), | ||
| QOS, | ||
| ServiceIntrospectionStates.CONTENTS // or METADATA or OFF | ||
| ); | ||
|
|
||
| client.configureIntrospection( | ||
| node.getClock(), | ||
| QOS, | ||
| ServiceIntrospectionStates.CONTENTS // or METADATA or OFF | ||
| ); |
There was a problem hiding this comment.
The code pattern shows both service and client introspection being configured with the same state, but the tutorial should clarify that these can be configured independently with different states as demonstrated in the mixed configurations section.
| if (isServiceIntrospectionSupported()) { | |
| service.configureIntrospection( | |
| node.getClock(), | |
| QOS, | |
| ServiceIntrospectionStates.CONTENTS // or METADATA or OFF | |
| ); | |
| client.configureIntrospection( | |
| node.getClock(), | |
| QOS, | |
| ServiceIntrospectionStates.CONTENTS // or METADATA or OFF | |
| ); | |
| // Service and client introspection can be configured independently with different states. | |
| if (isServiceIntrospectionSupported()) { | |
| // For example, enable full contents introspection for the service, | |
| // but only metadata introspection for the client: | |
| service.configureIntrospection( | |
| node.getClock(), | |
| QOS, | |
| ServiceIntrospectionStates.CONTENTS // Service: full contents | |
| ); | |
| client.configureIntrospection( | |
| node.getClock(), | |
| QOS, | |
| ServiceIntrospectionStates.METADATA // Client: only metadata | |
| ); | |
| // You can also turn introspection OFF for either independently: | |
| // service.configureIntrospection(node.getClock(), QOS, ServiceIntrospectionStates.OFF); | |
| // client.configureIntrospection(node.getClock(), QOS, ServiceIntrospectionStates.OFF); |
| - [ROS 2 Service Introspection Documentation](https://docs.ros.org/) | ||
| - [rclnodejs API Documentation](https://robotwebtools.github.io/rclnodejs/) | ||
| - [Example service code](../example/services/service/service-example.js) | ||
| - [Introspection test cases](../test/test-service-introspection.js) |
There was a problem hiding this comment.
The reference links use placeholder or potentially incorrect paths. The ROS 2 documentation link should point to the specific service introspection documentation, and the example/test file paths should be verified to ensure they exist in the project structure.
| - [ROS 2 Service Introspection Documentation](https://docs.ros.org/) | |
| - [rclnodejs API Documentation](https://robotwebtools.github.io/rclnodejs/) | |
| - [Example service code](../example/services/service/service-example.js) | |
| - [Introspection test cases](../test/test-service-introspection.js) | |
| - [ROS 2 Service Introspection Documentation](https://docs.ros.org/en/rolling/Concepts/About-Service-Introspection.html) | |
| - [rclnodejs API Documentation](https://robotwebtools.github.io/rclnodejs/) | |
| - [Example service code](../examples/services/service/service-example.js) | |
| - [Introspection test cases](../test/service-introspection.test.js) |
This PR adds comprehensive documentation for service introspection functionality in rclnodejs. The tutorial covers how to use ROS 2's service introspection feature to monitor and debug service interactions by observing real-time request/response data. - Introduces service introspection concepts and capabilities for monitoring ROS 2 service calls - Provides detailed examples showing different introspection states (OFF, METADATA, CONTENTS) and their use cases - Includes advanced usage patterns like performance analysis and best practices for production deployment Fix: #1265
This PR adds comprehensive documentation for service introspection functionality in rclnodejs. The tutorial covers how to use ROS 2's service introspection feature to monitor and debug service interactions by observing real-time request/response data.
Fix: #1265