Last active
December 18, 2021 11:57
-
-
Save AmitGupta7580/f260224456c11453d5f7ab8f6240291e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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