Skip to content

Commit abf4d03

Browse files
Conditionally call onLoop based on node status (#5700)
Signed-off-by: Steve Macenski <stevenmacenski@gmail.com>
1 parent 2cdc985 commit abf4d03

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎nav2_behavior_tree/src/behavior_tree_engine.cpp‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ BehaviorTreeEngine::run(
6767

6868
result = tree->tickOnce();
6969

70-
onLoop();
70+
if (result == BT::NodeStatus::RUNNING || result == BT::NodeStatus::IDLE) {
71+
onLoop();
72+
}
7173

7274
if (!loopRate.sleep()) {
7375
RCLCPP_DEBUG_THROTTLE(

0 commit comments

Comments
 (0)