mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 06:13:33 +08:00
Fix the case where the flight controller is connected to the battery (charge 100), QGC shows no battery
This commit is contained in:
@@ -604,7 +604,8 @@ protected:
|
||||
int lowest_battery_index = 0;
|
||||
|
||||
for (int i = 0; i < _battery_status_subs.size(); i++) {
|
||||
if (battery_status[i].connected && (battery_status[i].remaining < battery_status[lowest_battery_index].remaining)) {
|
||||
if (battery_status[i].connected && ((!battery_status[lowest_battery_index].connected)
|
||||
|| (battery_status[i].remaining < battery_status[lowest_battery_index].remaining))) {
|
||||
lowest_battery_index = i;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user