mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-28 08:40:35 +08:00
uavcan esc handling review suggestions
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user