Sim: Do not drain the battery all the way to zero yet

This commit is contained in:
Lorenz Meier
2016-02-28 17:17:59 +01:00
parent 730ce4535f
commit 8f46c07249

View File

@@ -270,8 +270,8 @@ void Simulator::handle_message(mavlink_message_t *msg, bool publish)
vbatt -= (0.5f * cellcount) * ((now - batt_sim_start) / discharge_interval_us);
if (vbatt < (cellcount * 1.5f)) {
vbatt = cellcount * 1.5f;
if (vbatt < (cellcount * 3.7f)) {
vbatt = cellcount * 3.7f;
}
battery_status_s battery_status;