I’m running PX4 SitL in Gazebo and trying to connect to it via python using MAVSDK server.
Code:
import mavsdk
drone = mavsdk.System(port=50041)
await drone.connect(system_address=f"udp://14541")
async for position in drone.telemetry.position():
print(position)
At first the position data is good, but it quickly gets out of sync. For instance, the telemetry data will show that the drone is in the air even long after it has landed. Even after shutting down the simulation old telemetry data will keep coming in, even 30 minutes later! Is there some sort of buffer in MAVSDK server that stores the incoming telemetry?