From 6d1495b659278836f2524ff276e9779ee8a995fa Mon Sep 17 00:00:00 2001 From: Wolfgang Hoenig Date: Wed, 7 Feb 2024 16:39:12 +0100 Subject: [PATCH 1/3] server cpp: improve handling of crashed CF When connecting two CFs and turning on off, the unicast connection of the other one essentially froze. There were two reasons: 1.) Division by zero caused a crash; 2.) The crazyflie_link_cpp essentially starved one connection. Fixes #419. --- crazyflie/deps/crazyflie_tools | 2 +- crazyflie/src/crazyflie_server.cpp | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/crazyflie/deps/crazyflie_tools b/crazyflie/deps/crazyflie_tools index 36ea3d401..4b6255529 160000 --- a/crazyflie/deps/crazyflie_tools +++ b/crazyflie/deps/crazyflie_tools @@ -1 +1 @@ -Subproject commit 36ea3d40161db8f580dbb8846789bc036a2ccedd +Subproject commit 4b6255529698e421f802b020eabeafd63b14be66 diff --git a/crazyflie/src/crazyflie_server.cpp b/crazyflie/src/crazyflie_server.cpp index 4a71e0245..07734ed32 100644 --- a/crazyflie/src/crazyflie_server.cpp +++ b/crazyflie/src/crazyflie_server.cpp @@ -828,9 +828,11 @@ class CrazyflieROS } auto stats = cf_.connectionStatsDelta(); - float ack_rate = stats.sent_count / stats.ack_count; - if (ack_rate < min_ack_rate_) { - RCLCPP_WARN(logger_, "Ack rate: %.1f %%", 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_) { From 6762111d07b8090dbbd76175d11030b4d1e36ca1 Mon Sep 17 00:00:00 2001 From: Wolfgang Hoenig Date: Wed, 7 Feb 2024 16:41:25 +0100 Subject: [PATCH 2/3] update submodule --- crazyflie/deps/crazyflie_tools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crazyflie/deps/crazyflie_tools b/crazyflie/deps/crazyflie_tools index 4b6255529..0ad0c3d79 160000 --- a/crazyflie/deps/crazyflie_tools +++ b/crazyflie/deps/crazyflie_tools @@ -1 +1 @@ -Subproject commit 4b6255529698e421f802b020eabeafd63b14be66 +Subproject commit 0ad0c3d791e2220d5ca832bd6d7f8a2fd3d5149f From fcb287a75f376fa7614003ddbee67562d4be6e63 Mon Sep 17 00:00:00 2001 From: Wolfgang Hoenig Date: Wed, 7 Feb 2024 16:43:07 +0100 Subject: [PATCH 3/3] update submodule --- crazyflie/deps/crazyflie_tools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crazyflie/deps/crazyflie_tools b/crazyflie/deps/crazyflie_tools index 0ad0c3d79..32218e742 160000 --- a/crazyflie/deps/crazyflie_tools +++ b/crazyflie/deps/crazyflie_tools @@ -1 +1 @@ -Subproject commit 0ad0c3d791e2220d5ca832bd6d7f8a2fd3d5149f +Subproject commit 32218e7429651a681edf573d2ec24006fb07591e