Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR should address the issue that one of our clients has raised and I've noticed as well: full charge voltage level is off by about 30%, and the max possible achievable percentage is like 77% which is odd for just about everyone. From what I've tested there's no way our usual 7.2Ah 12S lead acids can go above ~26.1V when not plugged into a charger.
Aside from a fix for that I've also ported my usual battery calculation system, which uses a lookup table along with level interpolation and should be much more accurate than the simple interpolation we had before. It also adds li-ion support if we ever needed that, but it'll need to be extended via a launch param when we actually need it.
There is some debate to be had if we should label 2V per cell as "empty" and 0% or 50% as it actually technically is. I think for now it may be best to keep the real values inside ROS as a baseline and then fudge it further up the line when it's displayed to layman users only.
Sources:
https://files.slack.com/files-pri/T04BZFRLG-F027D2SGB4N/untitled.png
http://www.solarnavigator.net/battery_charging.htm
Also closes #127 I guess, and fixes some indents because we yet again have mixed tabs and spaces for some reason.