I’m running px4 on a Pixhawk 6c with an Raspberry Pi 4 as companion computer (CC). The CC controls the drone using MAVSDK 1.4.9 and Python. During flight, I need to regularly query the currently used capacity for the current mission.
The Mavlink message “BATTERY_STATUS” should contain the needed fields.
However, the battery telemetry generator at
async for battery in drone.telemetry.battery():
only yields the fields
remaining_percent, though the protofile for the telemetry class contains all fields. Are there still some implementation details missing?
What would be my options?
In DroneKit, I could register a callback for a specific Mavlink message and receive it’s updates as JSON objects. Is there a similar functionality in MAVSDK?
Could I open a second connection to my flight controller with pymavlink and query the capacity there?