uas-at-ucla / suas-23-24

Software/Vision operations for UAS@UCLA, 2023-2024. For a list of tasks, visit https://github.com/orgs/uas-at-ucla/projects/1
3 stars 0 forks source link

Telemetry data #18

Open nathanchan631 opened 1 year ago

nathanchan631 commented 1 year ago

How can we get telemetry data for the drone?

kushhansagarwal commented 1 year 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 1 year ago

Looks good.