import asyncio
from mavsdk import System
async def run():
drone = System()
await drone.connect(system_address="udp://:14540")
status_text_task = asyncio.ensure_future(print_status_text(drone))
print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
if state.is_connected:
print(f"-- Connected to drone!")
break
print("Waiting for drone to have a global position estimate...")
async for health in drone.telemetry.health():
if health.is_global_position_ok and health.is_home_position_ok:
print("-- Global position estimate OK")
break
print("-- Arming")
await drone.action.arm()
print("-- Taking off")
await drone.action.takeoff()
await asyncio.sleep(10)
print("-- Landing")
await drone.action.land()
status_text_task.cancel()
async def print_status_text(drone):
try:
async for status_text in drone.telemetry.status_text():
print(f"Status: {status_text.type}: {status_text.text}")
except asyncio.CancelledError:
return
if __name__ == "__main__":
# Run the asyncio loop
asyncio.run(run())
when i run i am getting this output
This installation does not provide an embedded 'mavsdk_server' binary.
If you installed using pip, this means that 'mavsdk_server' is not distributed
for your platform yet (e.g. arm).
You will need to get and run the 'mavsdk_server' binary manually:
1. Download 'mavsdk_server' from: https://github.com/mavlink/mavsdk/releases
or build it from source.
2. Run it, e.g. on port 50051:
'./mavsdk_server -p 50051'
3. Set the 'mavsdk_server_address' and port when creating the System:
'drone = System(mavsdk_server_address='localhost', port=50051)'
please help me