Skip to content

Conversation

@minggangw
Copy link
Member

@minggangw minggangw commented Apr 30, 2025

This PR adds new graph-related methods to expose publisher and subscription information by topic.

  • Introduces native bindings and corresponding JavaScript wrappers for retrieving publishers and subscriptions info.
  • Adds test coverage in both TypeScript and JavaScript test files to verify the new functionality.
  • Updates build configuration and dependency lists to support the added functionality.

Fix: #1111

@minggangw minggangw requested a review from Copilot April 30, 2025 08:12
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 new graph-related methods to expose publisher and subscription information by topic.

  • Introduces native bindings and corresponding JavaScript wrappers for retrieving publishers and subscriptions info.
  • Adds test coverage in both TypeScript and JavaScript test files to verify the new functionality.
  • Updates build configuration and dependency lists to support the added functionality.

Reviewed Changes

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

Show a summary per file
File Description
test/types/index.test-d.ts Added type assertions for the new graph methods.
test/test-graph.js New tests verifying retrieval of publishers and subscriptions info.
src/rcl_utilities.h / .cpp Added conversion functions for topic endpoint information.
src/rcl_node_bindings.cpp Introduced new GetNodeNames method.
src/rcl_graph_bindings.cpp Added refactored helper and new endpoints for publishers and subscriptions.
src/rcl_client_bindings.cpp Added ServiceServerIsAvailable method for client bindings.
scripts/config.js Updated dependencies to include rcpputils.
lib/node.js Added JS wrapper methods for accessing new graph functions.
binding.gyp Included linking flag for rcpputils.

it('Get publishers info by topic', function () {
const node = rclnodejs.createNode('publisher_node');
const String = 'std_msgs/msg/String';
node.createPublisher(String, 'topic');
Copy link

Copilot AI Apr 30, 2025

Choose a reason for hiding this comment

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

The test for publishers info uses '/topic' while the created publisher uses 'topic'. Consider ensuring consistency in topic naming between creation and retrieval to avoid potential mismatches.

Suggested change
node.createPublisher(String, 'topic');
node.createPublisher(String, '/topic');

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

Coverage Status

coverage: 85.071% (+0.01%) from 85.061%
when pulling 00ccc98 on minggangw:add-missing-methods-graph
into 98d2b08 on RobotWebTools:develop.

@minggangw minggangw changed the title Add missing methods graph Add missing methods for graph Apr 30, 2025
@minggangw minggangw merged commit 131ebf8 into RobotWebTools:develop Apr 30, 2025
11 checks passed
minggangw added a commit that referenced this pull request Apr 30, 2025
This PR adds new graph-related methods to expose publisher and subscription information by topic. 

- Introduces native bindings and corresponding JavaScript wrappers for retrieving publishers and subscriptions info.  
- Adds test coverage in both TypeScript and JavaScript test files to verify the new functionality.  
- Updates build configuration and dependency lists to support the added functionality.

Fix: #1111
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 graph

2 participants