Arming using companion computer parameter

Hello all,

https://mavlink.io/en/services/arm_authorization.html
The above doc says, “When enabled by setting a parameter on flight stack, the drone will only arm the motors if authorized by a external entity.”

How exactly do I go about setting a parameter? Also which parameter and set it to what? Do note that I hope to do it using mavros.
Hope you can help me with this?
Thanks.

1 Like

Arm authorization is not implemented in ArduPilot. But yes, of course you can Arm the copter using a mavros command.

Did you searched for that?

Yes, I have been able to arm using:
rosrun mavros mavsafety arm

At present I can arm the rover(boat) using either QGC “or” using mavros.
I’m trying to make it such that it isn’t “or”, but it must be “and”, i.e, the QGC cannot arm the bot unless there is explicit permission received from a companion computer (using mavros, or anything else you suggest), that the boat can arm.
Thanks for your reply.

Arm auth is exposed in the lua bindings but not mavlink. A simple example is here:

1 Like

Yes, but considering that Lua scripts have the low priority while running, I’m not sure it would be wise to use it for critical safety checks that the companion computer will perform before giving the command to arm/disarm the boat.

Correct me if I’m wrong and do let me know how to proceed with the implementation.
Thanks.

What does this mean? I can’t find anything that explains what Arm auth is or what it does. Can you point me to something?

Basically it’s a mechanism to require an additional condition to be met prior to arming. The example script is just a battery check but others might be that a valid mission is loaded, or an external authorisation (UTM permissions etc) has been granted.

1 Like

@Ash_J,

The Lua based arm authorisation feature requires a positive “OK” from the lua script so there’s no issue with the priority with which Lua runs. E.g. the vehicle can’t arm until the script says it is OK to arm … so worst case the vehicle can’t arm but more broadly we haven’t had any reports of Lua script thread priority causing problems even in cases where the script is in control of the vehicle so I don’t think there’s any need to worry about this.

In case it helps, our developer wiki has a section re AP’s mavlink interface and includes a page on how mavlink messages can be used to arm/disarm the vehicle.

1 Like