Bug report
Required Info:
- Operating System:
- ROS2 Version:
- Version or commit hash:
- DDS implementation:
Steps to reproduce issue
Set default behavior tree default_nav_to_pose_bt_xml as navigate_w_recovery_and_replanning_only_if_path_becomes_invalid.xml in param file.
Use Simple Commander API and request any goal using:
-> goToPose(pose1, behavior_tree=’../my_navigate_to_pose_w_replanning_and_recovery.xml‘)
Here behavior_tree can be any tree (even same as default used by Nav2 but using file)
-> Then cancel the above navigation using cancelTask() API call.
-> Next use goToPose(pose2) or use Rviz2 to request different goal using default bt tree.
Expected behavior
Navigate to new goal(pose2) according to default behaviour tree.
Actual behavior
Nav2 navigates to cancelled goal(pose1) instead of new requested goal.
Gif is shown below as example.
Additional information

In this video I am using follow_point.xml as 2nd behavior (bug can be reproduced with any behavior), and then using nav2 API to cancel it.
Then rviz2 for another goal request.
I fell like this should have been solved by this PR. But maybe changing bt xml leads to some unforeseen circumstances.
Bug report
Required Info:
Steps to reproduce issue
Set default behavior tree
default_nav_to_pose_bt_xmlas navigate_w_recovery_and_replanning_only_if_path_becomes_invalid.xml in param file.Use Simple Commander API and request any goal using:
Expected behavior
Navigate to new goal(pose2) according to default behaviour tree.
Actual behavior
Nav2 navigates to cancelled goal(pose1) instead of new requested goal.
Gif is shown below as example.
Additional information
In this video I am using follow_point.xml as 2nd behavior (bug can be reproduced with any behavior), and then using nav2 API to cancel it.
Then rviz2 for another goal request.
I fell like this should have been solved by this PR. But maybe changing bt xml leads to some unforeseen circumstances.