Skip to content

Commit

Permalink
Log if BT rate is exceeded (#3909)
Browse files Browse the repository at this point in the history
(cherry picked from commit a11cdd8)
  • Loading branch information
SteveMacenski authored and mergify[bot] committed Oct 28, 2023
1 parent afe56f7 commit f8413bd
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 f8413bd

Please sign in to comment.