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
311 stars 70 forks source link

ActionServer cancelRequestHandler() missing goalHandler param #866

Closed wayneparrott closed 1 year ago

wayneparrott commented 1 year ago

While implementing an ActionServer I noticed the CancelCallback fn declaration is missing the GoalHandle parameter.

https://github.com/RobotWebTools/rclnodejs/blob/755a7a66f0b6bbd093a1f8d8cfcdefd3f64ea5f8/types/action_server.d.ts#L87

Based on the ROS2 C++ action api the CancelCallback declaration should be:

type CancelCallback<T extends TypeClass<ActionTypeClassName>> = (
    goalHandle: ServerGoalHandle<T>
  ) => Promise<CancelResponse> | CancelResponse;

Additionally, test-action-server.js includes 2 test cases that need small modification to reflect this change.