-
Notifications
You must be signed in to change notification settings - Fork 79
Add a demo for actions using typescript #1212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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"
ts_demo/actions/src/client.ts
Outdated
|
|
||
| try { | ||
| // Send the goal with feedback callback | ||
| console.log(goal); |
Copilot
AI
Jul 29, 2025
There was a problem hiding this comment.
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.
| console.log(goal); | |
| this.node.getLogger().debug(`Goal details: ${JSON.stringify(goal)}`); |
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
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.
Fix: #1211