Skip to content

Conversation

@minggangw
Copy link
Member

@minggangw minggangw commented Aug 28, 2025

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

Copilot AI review requested due to automatic review settings August 28, 2025 08:00
Copy link

Copilot AI left a 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 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)];
Copy link

Copilot AI Aug 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
descriptors[0].floatingPointRange = [new FloatingPointRange(0.0, 5.0, 0.1)];
descriptors[0].range = [new FloatingPointRange(0.0, 5.0, 0.1)];

Copilot uses AI. Check for mistakes.
Comment on lines 213 to 214
const robotName = this.node.getParameter('enable_logging');
console.log(`Logging enabled: ${robotName.value}`);
Copy link

Copilot AI Aug 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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}`);

Copilot uses AI. Check for mistakes.
@coveralls
Copy link

Coverage Status

coverage: 84.555%. remained the same
when pulling 89879b9 on minggangw:fix-1240
into 3dea196 on RobotWebTools:develop.

@minggangw minggangw merged commit 7c09e7e into RobotWebTools:develop Aug 28, 2025
27 of 28 checks passed
minggangw added a commit that referenced this pull request Sep 10, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide parameter service tutorial

2 participants