Skip to content

Commit

Permalink
Log if BT rate is exceeded (ros-navigation#3909)
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveMacenski authored Oct 28, 2023
1 parent c0fd78f commit a11cdd8
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 a11cdd8

Please sign in to comment.