Skip to content

Commit 2e1ee2a

Browse files
CihatAltiparmakMarc-Morcos
authored andcommitted
Fix bug in nav2_behavior_tree/bt_action_node (ros-navigation#3849)
* Fix bug in nav2_behavior_tree/bt_action_node * Fixed the bug in halt function inside nav2_behavior_tree/plugin/action/bt_action_node.hpp * Added new case to nav2_behavior_tree/plugin/action/bt_action_node.hpp for testing the scenario to cancel * Refactored existing cases in nav2_behavior_tree/plugin/action/bt_action_node.hpp Signed-off-by: CihatAltiparmak <cihataltiparmak1@gmail.com> * Fix bug in nav2_behavior_tree/bt_action_node * Fixed the bug in halt function inside nav2_behavior_tree/plugin/action/bt_action_node.hpp * Added new case to nav2_behavior_tree/plugin/action/bt_action_node.hpp for testing the scenario to cancel * Refactored existing cases in nav2_behavior_tree/plugin/action/bt_action_node.hpp Signed-off-by: CihatAltiparmak <cihataltiparmak1@gmail.com> --------- Signed-off-by: CihatAltiparmak <cihataltiparmak1@gmail.com>
1 parent d54256f commit 2e1ee2a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

nav2_behavior_tree/test/plugins/action/test_bt_action_node.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,13 @@ class FibonacciAction : public nav2_behavior_tree::BtActionNode<test_msgs::actio
151151
return BT::NodeStatus::SUCCESS;
152152
}
153153

154+
BT::NodeStatus on_cancelled() override
155+
{
156+
config().blackboard->set<std::vector<int>>("sequence", result_.result->sequence);
157+
config().blackboard->set<bool>("on_cancelled_triggered", true);
158+
return BT::NodeStatus::SUCCESS;
159+
}
160+
154161
static BT::PortsList providedPorts()
155162
{
156163
return providedBasicPorts({BT::InputPort<int>("order", "Fibonacci order")});

0 commit comments

Comments
 (0)