Recently I’ve been going through the Ardupilot codebase and I thought of expanding the AP_BattMonitor class to include a sort of runtime estimator, taking into account the overall energy consumption of all active elements (eventually adding external current sensors for finer inputs) and predicting the battery duration at the current speed.
It can be useful especially for rovers and boats on long-run missions to determine motor speed and adjust velocity according to the remaining runtime. Ideally implemented with state machine containing various power-level statuses to adopt in order to extend mission time to the battery limits.
Do you think it can practically work on the limited PixHawk hardware? Or is it more suited for a companion computer?