Skip to content

Commit

Permalink
Log if BT rate is exceeded (#3909) (#3913)
Browse files Browse the repository at this point in the history
(cherry picked from commit a11cdd8)

Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>
  • Loading branch information
mergify[bot] and SteveMacenski authored Oct 28, 2023
1 parent afe56f7 commit 6377c72
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nav2_behavior_tree/src/behavior_tree_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ BehaviorTreeEngine::run(

onLoop();

loopRate.sleep();
if (!loopRate.sleep()) {
RCLCPP_WARN(
rclcpp::get_logger("BehaviorTreeEngine"),
"Behavior Tree tick rate %0.2f was exceeded!",
1.0 / (loopRate.period().count() * 1.0e-9));
}
}
} catch (const std::exception & ex) {
RCLCPP_ERROR(
Expand Down

0 comments on commit 6377c72

Please sign in to comment.