Programatically know if vehicle is ready to arm

The doubt is in the title, I am trying to find out if there is a way to know programatically if the vehicle is ready to arm. I read about MAV_SYS_STATUS_PREARM_CHECK, but I have seen a post that the info in this message doesn’t include all the checks, since some are only done when there is a attempt from the user to arm.

I also read about the the SYS_STATUS parameters onboard_control_sensors_present,onboard_control_sensors_enabled andonboard_control_sensors_health, but then again I don’t know if they include all the conditions to arm.

So is there a practical way to find this or individually verifying each of the checks would be necessary?

This depends on the current flight mode before arming.
The vehicle can not be armed in GPS-required modes without a GPS lock, for example.
Check out this code and run it in different flight modes just after the simulated vehicle starts.

In my case, it would be best if I could verify and be sure to have a gps lock

I use the same logic in my code, while testing I noticed it pre_arm_status would be True even if in non-armable modes like AUTO or Emergency Stop was activated. If those two cases were the only ones, it’s a easy fix, but I don’t know which cases are included and which are not