Need help with adding custom pre-arm checks from a companion computer

Hi, I’m using the SITL simulator along with the QGroundControl for simulating a rover. In the pre-arm checks, I would like add a custom pre-arm check, which receives confirmation from a companion computer, if it’s okay to arm the rover or not. How this would work is that it would involve both the companion computer and ardupilot giving permission to arm before the rover arms itself.

How do I create the custom pre-arm check?

There are some MAVLink messages for exactly this,

(I’m not sure how closely AP follows the spec, but it will be close)

1 Like

The not yet released version of ArduCopter-4.0.6 rc1 contains pre-arm check information. If you compile that branch for the rover you can get it in there as well.

1 Like

Hi, thanks for your answer. I’m a newbie and don’t understand how to proceed from here. Can you explain/point me to certain resources which can help me follow through?

git clone
git checkout Copter-4.0
cd ardupilot
git submodule update --init --recursive
.\waf configure --board=CubeBlack
.\waf rover --upload

Maybe I should be more specific-
I’ll be using this as a rover(a boat), and hence am using a CubePurple.
Does this lead to any significant change in your answer?
Thanks for your help.

Having a little trouble adding the mavlink message. So I have added the target_system and target_component in the ardupilotmega.xml file. I have seen the ardupilot documentation on adding a mavlink message but it explain the high level process and does not provide any example.
Can’t understand how to proceed! I need the arming process to fail unless a ROS node doesn’t publish “please ARM” or something similar from a companion computer to “some” ROS topic

Check the MAV_SYS_STATUS message bits