mavlink / qgroundcontrol

Cross-platform ground control station for drones (Android, iOS, Mac OS, Linux, Windows)
http://qgroundcontrol.io
3.16k stars 3.5k forks source link

Add support for better battery information, similar to dji battery bar thingy #10601

Open DonLakeFlyer opened 1 year ago

DonLakeFlyer commented 1 year ago

Information from @MaEtUgR on discord: sure, I have to write a revised battery documentation but in short for the ground station interface the MAVLink message https://mavlink.io/en/messages/common.html#BATTERY_STATUS contains:

DonLakeFlyer commented 1 year ago

Also @MaEtUgR: In the mavlink docs this is still marked Work In Progress. Is this only available in master and not out in a stable yet?

MaEtUgR commented 1 year ago

In the mavlink docs this is still marked Work In Progress. Is this only available in master and not out in a stable yet?

@DonLakeFlyer The big part is in stable 1.13 (or even before):

The only thing that will newly get available in 1.14 is the information on how long it takes for the vehicle to return TIME_ESTIMATE_TO_TARGET.safe_return : https://github.com/PX4/PX4-Autopilot/blob/release/1.14/src/modules/mavlink/streams/TIME_ESTIMATE_TO_TARGET.hpp#L67 Before this message is not streamed at all.

MaEtUgR commented 1 year ago

Also note that if you want to test the remaining flight time in simulation it's not really easily accessible because it simulates no current and hence purely voltage-based estimation. I can make a pr where you can just enable it in the simulated estimation.

DonLakeFlyer commented 1 year ago

I can make a pr where you can just enable it in the simulated estimation.

Yeah. That would be helpful.

The problem is that as far as I can tell only TIME_ESIMATE_TO_TARGET will work for a battery bar thingy. Otherwise you get into the whole multi-battery mess and what do you do if you have multiple batteries reporting status?