GCS_MAVLink: send BATTERY_STATUS.energy_consumed if current measurement is available

This commit is contained in:
Holger Steinhaus 2018-01-10 09:12:47 +01:00 committed by WickedShell
parent d1a37a60b7
commit 36f0b429fb

View File

@ -197,7 +197,7 @@ void GCS_MAVLINK::send_battery_status(const AP_BattMonitor &battery, const uint8
battery.get_cell_voltages(instance).cells, // cell voltages battery.get_cell_voltages(instance).cells, // cell voltages
battery.has_current(instance) ? battery.current_amps(instance) * 100 : -1, // current battery.has_current(instance) ? battery.current_amps(instance) * 100 : -1, // current
battery.has_current(instance) ? battery.current_total_mah(instance) : -1, // total current battery.has_current(instance) ? battery.current_total_mah(instance) : -1, // total current
-1, // joules used battery.has_consumed_energy(instance) ? battery.consumed_wh(instance) * 36 : -1, // consumed energy in hJ (hecto-Joules)
battery.capacity_remaining_pct(instance)); battery.capacity_remaining_pct(instance));
} }