Skip to content

Conversation

@minggangw
Copy link
Member

@minggangw minggangw commented May 15, 2025

This PR adds support for action introspection by introducing configuration functions and tests in both the action client and server modules, as well as corresponding C++ bindings.

  • Added utility functions and tests to manage configuration of introspection for action clients and servers.
  • Introduced new C++ functions guarded by ROS_VERSION checks to support introspection configuration.
  • Updated both JavaScript and TypeScript test files to verify the new introspection functionality.

Fix: #1129

@minggangw minggangw requested a review from Copilot May 15, 2025 09:13
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 support for action introspection by introducing configuration functions and tests in both the action client and server modules, as well as corresponding C++ bindings.

  • Added utility functions and tests to manage configuration of introspection for action clients and servers.
  • Introduced new C++ functions guarded by ROS_VERSION checks to support introspection configuration.
  • Updated both JavaScript and TypeScript test files to verify the new introspection functionality.

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/utils.js Added utility function to check if introspection is supported
test/types/index.test-d.ts Added test assertions for client/server configuration introspection
test/test-action-server.js Added test case for action server introspection configuration
test/test-action-client.js Added test case for action client introspection configuration
src/rcl_action_server_bindings.cpp Added C++ binding for configuring introspection on action servers
src/rcl_action_client_bindings.cpp Added C++ binding for configuring introspection on action clients
lib/action/server.js Added introspection configuration function in ActionServer
lib/action/client.js Added introspection configuration function in ActionClient

configureIntrospection(clock, qos, introspectionState) {
if (DistroUtils.getDistroId() <= DistroUtils.getDistroId('jazzy')) {
console.warn(
'Service introspection is not supported by this versionof ROS 2'
Copy link

Copilot AI May 15, 2025

Choose a reason for hiding this comment

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

There is a missing space in the warning message: 'this versionof ROS 2' should be 'this version of ROS 2'.

Suggested change
'Service introspection is not supported by this versionof ROS 2'
'Service introspection is not supported by this version of ROS 2'

Copilot uses AI. Check for mistakes.
configureIntrospection(clock, qos, introspectionState) {
if (DistroUtils.getDistroId() <= DistroUtils.getDistroId('jazzy')) {
console.warn(
'Service introspection is not supported by this versionof ROS 2'
Copy link

Copilot AI May 15, 2025

Choose a reason for hiding this comment

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

There is a missing space in the warning message: 'this versionof ROS 2' should be 'this version of ROS 2'.

Suggested change
'Service introspection is not supported by this versionof ROS 2'
'Service introspection is not supported by this version of ROS 2'

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

coveralls commented May 15, 2025

Coverage Status

coverage: 84.742% (-0.1%) from 84.864%
when pulling 5d633a9 on minggangw:support-introspection-configuration-kilted
into 5e98a20 on RobotWebTools:develop.

@minggangw minggangw requested a review from Copilot May 15, 2025 09:28
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 extends action client/server functionality by adding introspection support across the codebase.

  • Added isActionIntrospectionSupported helper and tests for introspection support.
  • Extended C++ bindings and updated JavaScript modules for both action client and server to allow configuring introspection.
  • Updated TypeScript tests to verify the new introspection configuration functions.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/utils.js Added isActionIntrospectionSupported and imported DistroUtils
test/types/index.test-d.ts Added type tests for introspection configuration functions
test/test-action-server.js Added a test case for action server introspection configuration
test/test-action-client.js Added a test case for action client introspection configuration
src/rcl_action_server_bindings.cpp Introduced ConfigureActionServerIntrospection with conditional inclusion
src/rcl_action_client_bindings.cpp Introduced ConfigureActionClientIntrospection with conditional inclusion
lib/action/server.js Added configureIntrospection method for ActionServer
lib/action/client.js Added configureIntrospection method for ActionClient


#include <rcl/error_handling.h>
#include <rcl/rcl.h>
#include <rcl_action/action_client.h>
Copy link

Copilot AI May 15, 2025

Choose a reason for hiding this comment

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

The inclusion of 'rcl_action/action_client.h' in the server bindings file appears unnecessary since only server functionality is used; consider removing it to reduce potential confusion and maintain clean separation.

Suggested change
#include <rcl_action/action_client.h>

Copilot uses AI. Check for mistakes.
'use strict';

const assert = require('assert');
const { DistroUtils } = require('../index.js');
Copy link

Copilot AI May 15, 2025

Choose a reason for hiding this comment

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

[nitpick] For consistency with production code, consider importing DistroUtils directly from '../distro.js' instead of '../index.js' to avoid any potential circular dependency issues.

Suggested change
const { DistroUtils } = require('../index.js');
const { DistroUtils } = require('../distro.js');

Copilot uses AI. Check for mistakes.
@minggangw minggangw changed the title [Kilted] Support introspection for action client/server [Kilted] Support to configure introspection for action client/server May 15, 2025
@minggangw minggangw merged commit 79ac1b0 into RobotWebTools:develop May 16, 2025
11 checks passed
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.

[Kilted] Support introspection for action client/server

2 participants