Pymavlink arm / disarm script

Hello there, just trying to get my head around a simple python script to arm / disarm SITL Rover.

I have borrowed some functions from the Ardupilot Autotest code and tried to keep things as simple as possible.

I can arm the vehicle but cannot disarm.

Any hints or tips would be appreciated.

Kind regards, Ben


Link to code: https://gist.github.com/benboughton1/b5b12130f0448ecef928d8a30c84c4e8

Starting SITL:

./ardurover --model rover --speedup 3 --defaults ../../../Tools/autotest/default_params/rover.parm

Output from code:

starting...
motors armed? 0
arming throttle...
running cmd
ACK received: COMMAND_ACK {command : 400, result : 0}
motors armed: 0
attempt to disarm rover
running cmd
ACK received: COMMAND_ACK {command : 400, result : 0}
wait a long time in vase it takes a while...
motors armed: 128

Solved this one eventually. I was feeding in confirmation as p1, p1 as p2 etc. Gist has been updated. Hopefully helps other people in future with simple script to get started.

1 Like

I have a similar problem.
Unfortunately, the Gist above was removed.
Could you please re-upload your code or explain in detail what you did?

I am sorry I have a very foggy memory of this and have no idea what happened to the gist and why it has been removed. Hopefully some here can help you. The discord server is very active from memory too.