Custom failsafe function on Ardupilot

Hello. I saw somewhere in the documentation that lua script can custom failsafe.

Today I digged into lua script and found that lua script is only activate failsafe in guided mode at the situation that existing failsafe don’t cover, such as forward motor detecting failsafe, and can’t change existing failsafe.

My problem is below two :
(1) At the moving platform, sudden QLand Failsafe or QRTL failsafe will be very dangerous.

So I want to change failsafe to fly to the relative direction and relative position of moving platform.

(2)as far I know, at stabilize mode, If failsafe kicks in, aircraft immedietely disarm. I don’t want it, at qstabilize mode or stabilize mode, Flight mode should be changed to QRTL or QLand.

Is changing ardupilot code only one way for changing above failsafe behavior?


I’m considering using beacon, but the speed will be slow if in loiter mode, so I’m worrying about it.