mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
commander: Be more verbose about low battery warnings, do not trigger low battery warning sound in HIL
This commit is contained in:
@@ -1582,6 +1582,8 @@ int commander_thread_main(int argc, char *argv[])
|
|||||||
low_battery_voltage_actions_done = true;
|
low_battery_voltage_actions_done = true;
|
||||||
if (armed.armed) {
|
if (armed.armed) {
|
||||||
mavlink_log_critical(mavlink_fd, "LOW BATTERY, RETURN TO LAND ADVISED");
|
mavlink_log_critical(mavlink_fd, "LOW BATTERY, RETURN TO LAND ADVISED");
|
||||||
|
} else {
|
||||||
|
mavlink_log_critical(mavlink_fd, "LOW BATTERY, TAKEOFF DISCOURAGED");
|
||||||
}
|
}
|
||||||
status.battery_warning = vehicle_status_s::VEHICLE_BATTERY_WARNING_LOW;
|
status.battery_warning = vehicle_status_s::VEHICLE_BATTERY_WARNING_LOW;
|
||||||
status_changed = true;
|
status_changed = true;
|
||||||
@@ -2054,11 +2056,13 @@ int commander_thread_main(int argc, char *argv[])
|
|||||||
set_tune(TONE_ARMING_WARNING_TUNE);
|
set_tune(TONE_ARMING_WARNING_TUNE);
|
||||||
arm_tune_played = true;
|
arm_tune_played = true;
|
||||||
|
|
||||||
} else if (status.battery_warning == vehicle_status_s::VEHICLE_BATTERY_WARNING_CRITICAL) {
|
} else if (status.hil_state != vehicle_status_s::HIL_STATE_ON) &&
|
||||||
|
status.battery_warning == vehicle_status_s::VEHICLE_BATTERY_WARNING_CRITICAL) {
|
||||||
/* play tune on battery critical */
|
/* play tune on battery critical */
|
||||||
set_tune(TONE_BATTERY_WARNING_FAST_TUNE);
|
set_tune(TONE_BATTERY_WARNING_FAST_TUNE);
|
||||||
|
|
||||||
} else if (status.battery_warning == vehicle_status_s::VEHICLE_BATTERY_WARNING_LOW || status.failsafe) {
|
} else if (status.hil_state != vehicle_status_s::HIL_STATE_ON) &&
|
||||||
|
(status.battery_warning == vehicle_status_s::VEHICLE_BATTERY_WARNING_LOW || status.failsafe)) {
|
||||||
/* play tune on battery warning or failsafe */
|
/* play tune on battery warning or failsafe */
|
||||||
set_tune(TONE_BATTERY_WARNING_SLOW_TUNE);
|
set_tune(TONE_BATTERY_WARNING_SLOW_TUNE);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user