Hello,
I own a Pixhawk Orange Cube and a telemetry transceiver device (RFD868x). The telemetry device is connected to my computer at USB0.
First, I start the MAVSDK server with the following command:
bash
./mavsdk_server -p 50051 serial:///dev/ttyUSB0:57600
Then, when I try to arm the drone with this simple code:
python
Kodu kopyala
import mavsdk
async def run():
# Specify the MAVSDK server address
drone = mavsdk.System(mavsdk_server_address="localhost", port=50051)
await drone.connect(system_address="serial:///dev/ttyUSB0:57600")
async for state in drone.core.connection_state():
if state.is_connected:
print("Drone connected")
break
# Arm the drone
print("Arming the drone...")
try:
action = drone.action # Access the Action class
await action.arm()
print("Drone armed successfully")
except mavsdk.action.ActionError as e:
print(f"Failed to arm the drone: {e}")
if __name__ == "__main__":
import asyncio
loop = asyncio.get_event_loop()
loop.run_until_complete(run())
I am unable to arm the drone. The output is:
Drone connected
Arming the drone…
Failed to arm the drone: COMMAND_DENIED: ‘Command Denied’; origin: arm(); params: ()
However, I can arm the drone and execute commands using QGroundControl or Mission Planner.