You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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())
The text was updated successfully, but these errors were encountered:
Can you elaborate on your use-case? Do you want MAVSDK to behave like an autopilot? Because your code above tries to connect MAVSDK as a ground station to QGC, which probably won't work.
Can you elaborate on your use-case? Do you want MAVSDK to behave like an autopilot? Because your code above tries to connect MAVSDK as a ground station to QGC, which probably won't work.
Yes, I want that MAVSDK behave like a generic autopilot and I want to connect the QGC, in another words - what do I require for a connection to be established with a generic autopilot?
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()
if name == "main":
loop = asyncio.get_event_loop()
loop.run_until_complete(run())
The text was updated successfully, but these errors were encountered: