From 816b92346e08c6caff6b3528bcc0d2effea0bffa Mon Sep 17 00:00:00 2001 From: Iampete1 Date: Fri, 13 Oct 2023 13:00:41 +0100 Subject: [PATCH] AP_BattMonitor: DroneCAN: always have consumed energy --- libraries/AP_BattMonitor/AP_BattMonitor_DroneCAN.cpp | 1 - libraries/AP_BattMonitor/AP_BattMonitor_DroneCAN.h | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/libraries/AP_BattMonitor/AP_BattMonitor_DroneCAN.cpp b/libraries/AP_BattMonitor/AP_BattMonitor_DroneCAN.cpp index c7514f8fb3..d4b7aed2a9 100644 --- a/libraries/AP_BattMonitor/AP_BattMonitor_DroneCAN.cpp +++ b/libraries/AP_BattMonitor/AP_BattMonitor_DroneCAN.cpp @@ -157,7 +157,6 @@ void AP_BattMonitor_DroneCAN::handle_battery_info_aux(const ardupilot_equipment_ _has_cell_voltages = true; _has_time_remaining = true; - _has_consumed_energy = true; _has_battery_info_aux = true; } diff --git a/libraries/AP_BattMonitor/AP_BattMonitor_DroneCAN.h b/libraries/AP_BattMonitor/AP_BattMonitor_DroneCAN.h index 2b70f5d244..6b6151d477 100644 --- a/libraries/AP_BattMonitor/AP_BattMonitor_DroneCAN.h +++ b/libraries/AP_BattMonitor/AP_BattMonitor_DroneCAN.h @@ -35,7 +35,8 @@ public: bool has_current() const override { return true; } - bool has_consumed_energy() const override { return _has_consumed_energy; } + // Always have consumed energy, either directly from BatteryInfoAux msg or by cumulative current draw + bool has_consumed_energy() const override { return true; } bool has_time_remaining() const override { return _has_time_remaining; } @@ -99,7 +100,6 @@ private: bool _has_temperature; bool _has_cell_voltages; bool _has_time_remaining; - bool _has_consumed_energy; bool _has_battery_info_aux; uint8_t _instance; // instance of this battery monitor