Skip to content

[Action] Add ActionEndpointInfo and action graph count APIs - #1571

Open
minggangw wants to merge 3 commits into
RobotWebTools:developfrom
minggangw:fix-1570
Open

[Action] Add ActionEndpointInfo and action graph count APIs#1571
minggangw wants to merge 3 commits into
RobotWebTools:developfrom
minggangw:fix-1570

Conversation

@minggangw

@minggangw minggangw commented Aug 10, 2026

Copy link
Copy Markdown
Member

Adds new ROS 2 action-graph query capabilities to rclnodejs, exposing action client/server counts and per-endpoint metadata through the Node API and corresponding TypeScript types.

Changes:

  • Add Node.countActionClients/countActionServers and endpoint-info query APIs for actions.
  • Introduce ActionEndpointInfo (JS + TS) to represent aggregated action endpoint metadata.
  • Extend native graph bindings/utilities and add tests/type-tests for the new APIs.

Fix: #1570

Copilot AI lite review requested due to automatic review settings August 10, 2026 06:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds new ROS 2 action-graph query capabilities to rclnodejs, exposing action client/server counts and per-endpoint metadata through the Node API and corresponding TypeScript types.

Changes:

  • Add Node.countActionClients/countActionServers and endpoint-info query APIs for actions.
  • Introduce ActionEndpointInfo (JS + TS) to represent aggregated action endpoint metadata.
  • Extend native graph bindings/utilities and add tests/type-tests for the new APIs.

Reviewed changes

Copilot reviewed 8 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
types/node.d.ts Declares new Node action graph count + endpoint-info APIs.
types/base.d.ts Wires in the new action_endpoint_info.d.ts reference.
types/action_endpoint_info.d.ts Adds TS declarations for ActionEndpointInfo and related endpoint info shapes.
test/types/index.test-d.ts Adds d.ts assertions for the new Node APIs and ActionEndpointInfo.
test/test-action-graph.js Adds runtime tests for action client/server counts and endpoint info queries.
src/rcl_utilities.h Declares JS conversion helper for action endpoint info arrays (ROS_VERSION >= 5000).
src/rcl_utilities.cpp Implements action endpoint info conversion + adds null-string guards for endpoint fields.
src/rcl_graph_bindings.cpp Adds native bindings for action count and action endpoint info queries.
lib/node.js Exposes new Node methods and maps native endpoint info into ActionEndpointInfo instances.
lib/action/endpoint_info.js Implements ActionEndpointInfo JS wrapper over native endpoint data.
index.js Exports ActionEndpointInfo from the package entrypoint.
Suppressed comments (2)

src/rcl_graph_bindings.cpp:437

  • countActionClients/countActionServers are exported under ROS_VERSION >= 2605, but their implementations should be ROS_VERSION >= 5000 only. As-is, builds with ROS_VERSION between 2605 and 4999 will reference undefined symbols. Move the two exports into the existing ROS_VERSION >= 5000 block (keep the service info exports under >= 2605).
#if ROS_VERSION >= 2605
  exports.Set("countActionClients",
              Napi::Function::New(env, CountActionClients));
  exports.Set("countActionServers",
              Napi::Function::New(env, CountActionServers));

test/test-action-graph.js:309

  • This test assumes the action endpoint info APIs exist. On distros older than Rolling, getActionServersInfoByAction returns null, and waitForEndpointInfo will throw when accessing .length. Skip this test unless DistroId.ROLLING.
  it('Test getActionServersInfoByAction', async function () {
    const infos = await waitForEndpointInfo(

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

#include <rcl/error_handling.h>
#include <rcl/graph.h>
#include <rcl/rcl.h>
#include <rcl_action/graph.h>
return result_list;
}

#if ROS_VERSION >= 2605
Comment thread test/test-action-graph.js
Comment on lines +256 to +257
it('Test countActionClients and countActionServers', async function () {
assert.strictEqual(
Comment thread test/test-action-graph.js
Comment on lines +275 to +276
it('Test getActionClientsInfoByAction', async function () {
const infos = await waitForEndpointInfo(
@coveralls

coveralls commented Aug 10, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 91.047% (-0.06%) from 91.102% — minggangw:fix-1570 into RobotWebTools:develop

countActionClients/countActionServers require rcl_action_count_* (Lyrical+) and the endpoint info queries require rcl_action_get_*_info_by_action (Rolling only). Without gating these return null, so arm64 CI failed with 'null !== 1' and 'Cannot read properties of null' on humble, jazzy, kilted and lyrical.
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 ActionEndpointInfo

3 participants