RobotWebTools / rclnodejs

Node.js version of ROS 2.0 client
https://docs.ros.org/en/humble/Concepts/Basic/About-Client-Libraries.html?highlight=rclnodejs#community-maintained
Apache License 2.0
320 stars 70 forks source link

Fix ActionServer cancelCallback declaration, doc & test #867

Closed wayneparrott closed 2 years ago

wayneparrott commented 2 years ago

While the ActionServer implementation will pass it's CancelCallback function a ServerGoalHandler argument, this fact is not clearly documented, not illustrated in the actionserver tests and the TS CancelCallback function declaration does not include a ServerGoalHandle parameter.

This PR updates docs, test suite and modifies the TypeScript CancelCallback function declaration to include a required ServerGoalHandle parameter. The change breaks existing TypeScript ActionServers that implement a custom CancelCallback function with a compilation error.

Question: To make this a non-breaking change we can make the ServerGoalHandle optional. Thoughts?

Fix #866