Skip to content

Conversation

@minggangw
Copy link
Member

@minggangw minggangw commented May 4, 2025

This PR adds the missing client methods by implementing and exposing a getOptions function for services. The changes include updating TypeScript tests to verify the new method, adding a new service options test in JavaScript, implementing the ConvertToQoS function in C++ along with the GetOptions binding, and adding a getOptions method in the Service JavaScript class.

Fix: #1115

@minggangw minggangw requested a review from Copilot May 4, 2025 15:37
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 the missing client methods by implementing and exposing a getOptions function for services. The changes include updating TypeScript tests to verify the new method, adding a new service options test in JavaScript, implementing the ConvertToQoS function in C++ along with the GetOptions binding, and adding a getOptions method in the Service JavaScript class.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/types/index.test-d.ts Added a type assertion for service.getOptions().
test/test-service.js Added a new test verifying the returned service options from getOptions().
src/rcl_utilities.h Declared the ConvertToQoS function to support new QoS conversions.
src/rcl_utilities.cpp Moved/reintroduced the implementation of ConvertToQoS with updated namespace usage.
src/rcl_service_bindings.cpp Added the GetOptions binding and exported getOptions through the service bindings.
lib/service.js Added the getOptions method to the Service class to expose service option functionality.

RclHandle::Unwrap(info[0].As<Napi::Object>())->ptr());

const rcl_service_options_t* options = rcl_service_get_options(service);
auto qos_profile = ConvertToQoS(env, &options->qos);
Copy link

Copilot AI May 4, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider using the fully qualified name 'rclnodejs::ConvertToQoS' for clarity and consistency with its usage elsewhere in the codebase.

Suggested change
auto qos_profile = ConvertToQoS(env, &options->qos);
auto qos_profile = rclnodejs::ConvertToQoS(env, &options->qos);

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

Coverage Status

coverage: 85.076% (+0.005%) from 85.071%
when pulling 0c5ea6b on minggangw:add-missing-from-service
into 5dc2276 on RobotWebTools:develop.

@minggangw minggangw merged commit 2d70163 into RobotWebTools:develop May 4, 2025
11 checks passed
minggangw added a commit that referenced this pull request May 6, 2025
This PR adds the missing client methods by implementing and exposing a getOptions function for services. The changes include updating TypeScript tests to verify the new method, adding a new service options test in JavaScript, implementing the ConvertToQoS function in C++ along with the GetOptions binding, and adding a getOptions method in the Service JavaScript class.

Fix: #1115
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.

Add missing methods for client

2 participants