Skip to content

Commit

Permalink
Merge pull request #420 from IMRCLab/issue419
Browse files Browse the repository at this point in the history
server cpp: improve handling of crashed CF
  • Loading branch information
Khaledwahba1994 authored Feb 14, 2024
2 parents 24b8a2d + 034dd27 commit db3a9cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crazyflie/deps/crazyflie_tools
Submodule crazyflie_tools updated 1 files
+1 −1 crazyflie_cpp
9 changes: 6 additions & 3 deletions crazyflie/src/crazyflie_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -865,9 +865,12 @@ class CrazyflieROS
}

auto stats = cf_.connectionStatsDelta();
float ack_rate = stats.sent_count / stats.ack_count;
if (ack_rate < min_ack_rate_) {
RCLCPP_WARN(logger_, "[%s] Ack rate: %.1f %%", name_.c_str(), ack_rate * 100);

if (stats.ack_count > 0) {
float ack_rate = stats.sent_count / stats.ack_count;
if (ack_rate < min_ack_rate_) {
RCLCPP_WARN(logger_, "Ack rate: %.1f %%", name_.c_str(), ack_rate * 100);
}
}

if (publish_stats_) {
Expand Down

0 comments on commit db3a9cf

Please sign in to comment.