uavcan esc handling review suggestions

This commit is contained in:
Matthias Grob
2026-02-19 19:58:49 +01:00
committed by Nick
parent 790c2d3369
commit ca0dec5a33
5 changed files with 35 additions and 38 deletions
@@ -132,7 +132,7 @@ void EscChecks::checkEscStatus(const Context &context, Report &reporter, const e
mavlink_log_critical(reporter.mavlink_log_pub(), "%soffline. %s\t", esc_fail_msg, context.isArmed() ? "Land now!" : "");
}
for (int index = 0; index < esc_status_s::CONNECTED_ESC_MAX; ++index) {
for (int index = 0; index < esc_status_s::CONNECTED_ESC_MAX; ++index) {
if (esc_status.esc[index].failures != 0) {
@@ -183,6 +183,10 @@ void FailureDetector::updateEscsStatus(const vehicle_status_s &vehicle_status, c
bool is_esc_failure = !is_all_escs_armed;
for (int i = 0; i < limited_esc_count; i++) {
is_esc_failure = is_esc_failure || (esc_status.esc[i].failures > 0);
}
_esc_failure_hysteresis.set_hysteresis_time_from(false, 300_ms);
_esc_failure_hysteresis.set_state_and_update(is_esc_failure, now);