-
Notifications
You must be signed in to change notification settings - Fork 240
Open
Description
I want to connect to QGC, i using this code, but QGC still shows on the main screen disconnected. why is this happen?
import asyncio
from mavsdk import System
async def run():
# Create a MAVSDK system object
drone = System()
# Connect to the drone via QGC's UDP port (assuming QGC is configured to listen on 14550)
await drone.connect(system_address="udp://192.168.168.95:14550")
print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
if state.is_connected:
print(f"Drone discovered with UUID: {state.uuid}")
break
print("Drone connected!")
# Listen for heartbeat messages
async for heartbeat in drone.telemetry.heartbeat():
print(f"Heartbeat: {heartbeat}")
if name == "main":
loop = asyncio.get_event_loop()
loop.run_until_complete(run())
Metadata
Metadata
Assignees
Labels
No labels