mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 21:13:33 +08:00
Merged with master
This commit is contained in:
@@ -1253,6 +1253,8 @@ int commander_thread_main(int argc, char *argv[])
|
||||
current_status.flag_external_manual_override_ok = true;
|
||||
/* flag position info as bad, do not allow auto mode */
|
||||
current_status.flag_vector_flight_mode_ok = false;
|
||||
/* set battery warning flag */
|
||||
current_status.battery_warning = VEHICLE_BATTERY_WARNING_NONE;
|
||||
|
||||
/* advertise to ORB */
|
||||
stat_pub = orb_advertise(ORB_ID(vehicle_status), ¤t_status);
|
||||
@@ -1510,6 +1512,7 @@ int commander_thread_main(int argc, char *argv[])
|
||||
if (low_voltage_counter > LOW_VOLTAGE_BATTERY_COUNTER_LIMIT) {
|
||||
low_battery_voltage_actions_done = true;
|
||||
mavlink_log_critical(mavlink_fd, "[cmd] WARNING! LOW BATTERY!");
|
||||
current_status.battery_warning = VEHICLE_BATTERY_WARNING_WARNING;
|
||||
}
|
||||
|
||||
low_voltage_counter++;
|
||||
@@ -1520,6 +1523,7 @@ int commander_thread_main(int argc, char *argv[])
|
||||
if (critical_voltage_counter > CRITICAL_VOLTAGE_BATTERY_COUNTER_LIMIT) {
|
||||
critical_battery_voltage_actions_done = true;
|
||||
mavlink_log_critical(mavlink_fd, "[cmd] EMERGENCY! CRITICAL BATTERY!");
|
||||
current_status.battery_warning = VEHICLE_BATTERY_WARNING_ALERT;
|
||||
state_machine_emergency(stat_pub, ¤t_status, mavlink_fd);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user