Skip to content
Snippets Groups Projects
Commit 1ecfaff6 authored by Lorenz Meier's avatar Lorenz Meier
Browse files

Fix up power consumption estimation

parent 4beca408
No related branches found
No related tags found
No related merge requests found
......@@ -120,7 +120,7 @@ Battery::sumDischarged(hrt_abstime timestamp, float current_a)
// Ignore first update because we don't know dT.
if (_last_timestamp != 0) {
_discharged_mah = current_a * (timestamp - _last_timestamp) * 1.0e-3f / 3600.0f;
_discharged_mah += current_a * ((float)(timestamp - _last_timestamp)) / 1e3f / 3600.0f;
}
_last_timestamp = timestamp;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment