Provide parameter service tutorial#1242
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds a comprehensive tutorial for the ROS 2 parameter service functionality in rclnodejs, providing documentation for dynamic configuration management, parameter validation, and runtime parameter updates.
- Comprehensive tutorial covering ROS 2 parameters from basic usage to advanced features
- Complete code examples demonstrating parameter declaration, validation, and service implementation
- Best practices and CLI usage examples for parameter management
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| // Add range validation for speed | ||
| const FloatingPointRange = rclnodejs.FloatingPointRange; | ||
| descriptors[0].floatingPointRange = [new FloatingPointRange(0.0, 5.0, 0.1)]; |
There was a problem hiding this comment.
The property name should be range instead of floatingPointRange based on the earlier examples in the tutorial that use descriptors[0].range. This inconsistency could confuse users.
| descriptors[0].floatingPointRange = [new FloatingPointRange(0.0, 5.0, 0.1)]; | |
| descriptors[0].range = [new FloatingPointRange(0.0, 5.0, 0.1)]; |
| const robotName = this.node.getParameter('enable_logging'); | ||
| console.log(`Logging enabled: ${robotName.value}`); |
There was a problem hiding this comment.
The variable name robotName is misleading as it's getting the 'enable_logging' parameter, not a robot name parameter. This should be renamed to match the parameter being retrieved.
| const robotName = this.node.getParameter('enable_logging'); | |
| console.log(`Logging enabled: ${robotName.value}`); | |
| const enableLogging = this.node.getParameter('enable_logging'); | |
| console.log(`Logging enabled: ${enableLogging.value}`); |
This PR adds a comprehensive tutorial for the ROS 2 parameter service functionality in rclnodejs, providing documentation for dynamic configuration management, parameter validation, and runtime parameter updates. - Comprehensive tutorial covering ROS 2 parameters from basic usage to advanced features - Complete code examples demonstrating parameter declaration, validation, and service implementation - Best practices and CLI usage examples for parameter management Fix: #1240
This PR adds a comprehensive tutorial for the ROS 2 parameter service functionality in rclnodejs, providing documentation for dynamic configuration management, parameter validation, and runtime parameter updates.
Fix: #1240