Skip to content

Instantly share code, notes, and snippets.

@AmitGupta7580
Last active December 18, 2021 11:57
Show Gist options
  • Save AmitGupta7580/f260224456c11453d5f7ab8f6240291e to your computer and use it in GitHub Desktop.
Save AmitGupta7580/f260224456c11453d5f7ab8f6240291e to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import asyncio
from mavsdk import System
async def run():
drone = System()
await drone.connect(system_address="serial:///dev/ttyUSB0")
print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
if state.is_connected:
print("Drone discovered!")
break
print("-- Arming")
await drone.action.arm()
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(run())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment