Skip to content

Conversation

@minggangw
Copy link
Member

@minggangw minggangw commented Jul 29, 2025

This PR adds a comprehensive TypeScript demo for ROS2 actions using rclnodejs. The demo implements a Fibonacci sequence calculator with both action client and server components, providing a complete example of how to use actions in TypeScript.

  • Implements TypeScript action server and client for Fibonacci calculation
  • Provides comprehensive documentation and setup instructions
  • Includes build configuration with proper TypeScript tooling
  • Fixes a minor issue in the existing JavaScript action client example

Fix: #1211

@minggangw minggangw requested a review from Copilot July 29, 2025 04:56
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 TypeScript demo for ROS2 actions using rclnodejs. The demo implements a Fibonacci sequence calculator with both action client and server components, providing a complete example of how to use actions in TypeScript.

  • Implements TypeScript action server and client for Fibonacci calculation
  • Provides comprehensive documentation and setup instructions
  • Includes build configuration with proper TypeScript tooling
  • Fixes a minor issue in the existing JavaScript action client example

Reviewed Changes

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

Show a summary per file
File Description
ts_demo/actions/tsconfig.json TypeScript configuration with ES2020 target and proper module settings
ts_demo/actions/src/server.ts Action server implementation with goal validation, feedback, and cancellation handling
ts_demo/actions/src/client.ts Action client implementation that sends goals and handles feedback
ts_demo/actions/package.json Project configuration with build scripts and dependencies
ts_demo/actions/README.md Comprehensive documentation with setup instructions and usage examples
example/actions/action_client/action-client-example.js Fix for proper async/await handling in goal sending
Comments suppressed due to low confidence (3)

ts_demo/actions/package.json:30

  • The version "^22.16.5" for @types/node does not exist. The latest version in the 22.x series is 22.10.x. Consider using "^22.10.0" instead.
    "@types/node": "^22.16.5",

ts_demo/actions/package.json:32

  • The version "^6.0.1" for rimraf does not exist. The latest version is 5.x series. Consider using "^5.0.0" instead.
    "rimraf": "^6.0.1",

ts_demo/actions/package.json:34

  • The version "^5.8.3" for TypeScript does not exist. The latest version in the 5.x series is 5.7.x. Consider using "^5.7.0" instead.
    "typescript": "^5.8.3"


try {
// Send the goal with feedback callback
console.log(goal);
Copy link

Copilot AI Jul 29, 2025

Choose a reason for hiding this comment

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

Debug console.log statement should be removed or replaced with proper logging using the node's logger for consistency with the rest of the codebase.

Suggested change
console.log(goal);
this.node.getLogger().debug(`Goal details: ${JSON.stringify(goal)}`);

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

coveralls commented Jul 29, 2025

Coverage Status

coverage: 84.526%. remained the same
when pulling 2d7bbc0 on minggangw:fix-1211
into 605eb84 on RobotWebTools:develop.

@minggangw minggangw merged commit b74162e into RobotWebTools:develop Jul 29, 2025
19 checks passed
minggangw added a commit that referenced this pull request Jul 31, 2025
This PR adds a comprehensive TypeScript demo for ROS2 actions using rclnodejs. The demo implements a Fibonacci sequence calculator with both action client and server components, providing a complete example of how to use actions in TypeScript.

- Implements TypeScript action server and client for Fibonacci calculation
- Provides comprehensive documentation and setup instructions
- Includes build configuration with proper TypeScript tooling
- Fixes a minor issue in the existing JavaScript action client example

Fix: #1211
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 a demo for actions using typescript

2 participants