From a63706396535e71feeafb172fbb8a8576d5d6181 Mon Sep 17 00:00:00 2001 From: nanthony21 <nickexists@hotmail.com> Date: Sat, 10 Feb 2018 20:15:29 -0600 Subject: [PATCH] fix formattting --- src/modules/systemlib/battery.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/systemlib/battery.cpp b/src/modules/systemlib/battery.cpp index c1d5c7b56c..242856904c 100644 --- a/src/modules/systemlib/battery.cpp +++ b/src/modules/systemlib/battery.cpp @@ -174,7 +174,7 @@ Battery::estimateRemaining(float voltage_v, float current_a, float throttle_norm // remaining battery capacity based on voltage float cell_voltage = voltage_v / _n_cells.get(); - + // correct battery voltage locally for load drop to avoid estimation fluctuations if (_r_internal.get() >= 0.f) { cell_voltage += _r_internal.get() * current_a; @@ -184,6 +184,7 @@ Battery::estimateRemaining(float voltage_v, float current_a, float throttle_norm // good assumption if throttle represents RPM cell_voltage += throttle_normalized * throttle_normalized * _v_load_drop.get(); } + _remaining_voltage = math::gradual(cell_voltage, _v_empty.get(), _v_charged.get(), 0.f, 1.f); // choose which quantity we're using for final reporting -- GitLab