uas-at-ucla / uas-2024

3 stars 0 forks source link

Telemetry data #18

Open nathanchan631 opened 11 months ago

nathanchan631 commented 11 months ago

How can we get telemetry data for the drone?

kushhansagarwal commented 10 months ago

Documentation

MAVSDK has the following methods on the class mavsdk.telemetry.Telemetry(async_plugin_manager) class for getting various drone telemetry data

Sample Code

async def print_battery(drone):
    async for battery in drone.telemetry.battery():
        print(f"Battery: {battery.remaining_percent}")

async def print_gps_info(drone):
    async for gps_info in drone.telemetry.gps_info():
        print(f"GPS info: {gps_info}")

async def print_in_air(drone):
    async for in_air in drone.telemetry.in_air():
        print(f"In air: {in_air}")

async def print_position(drone):
    async for position in drone.telemetry.position():
        print(position)
nathanchan631 commented 10 months ago

Looks good.