BehaviorTree.ROS2 icon indicating copy to clipboard operation
BehaviorTree.ROS2 copied to clipboard

Fix for #57 only works reliably for the very first goal

Open robin-mueller opened this issue 1 year ago • 3 comments

As I commented after the fix for the original issue #57 , cancelGoal() still doesn't work correctly for pre-response action cancellation. The issue now is, that goal_handle_ is not reset after a previous goal has terminated, which causes this condition to always become true after the first goal response. Therefore the function misleadingly assumes for any subsequent goals that the corresponding response has already arrived. As a result, an rclcpp_action::UnkownGoalError is thrown in action_client->async_get_result() if cancelGoal() is called when the current goal has not arrived yet, since goal_handle_ refers to the previous, already terminated goal.

We either have to reset goal_handle_ appropriately, or refer to the currently relevant goal uuid if we want to verify that the response has arrived.

I also suggested an entirely different implementation of RosActionNode here, which would prevent this issue from ocurring in the first place (Behavior A: Wait for goal response during initial tick).

robin-mueller avatar May 20 '24 01:05 robin-mueller

Is there any update on this topic? If we decide on an approach to fix this issue, I can prepare a pull request.

robin-mueller avatar Jul 10 '24 11:07 robin-mueller

I had the same problem when canceling goals multiple times (working only the very first time) getting as result rclcpp_action::UnkownGoalError. Adding goal_handle_ = nullptr; at this line fixes.

fafux avatar Sep 10 '25 15:09 fafux

I am currently experiencing a similar issue mentioned in #110 and the fix provided by @fafux seems to fix this too.

flbeck avatar Sep 22 '25 13:09 flbeck