-
Notifications
You must be signed in to change notification settings - Fork 79
Add tutorial for service introspection #1266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 | ||
| ); |
Copilot
AI
Sep 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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); |
tutorials/service-introspection.md
Outdated
| - [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) |
Copilot
AI
Sep 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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