Drone gets disarmed automatically in offboard mode

Hello all, @jimdgit, @LorenzMeier @JulianOes

I am trying to fly my dIY drone in offboard mode. I have setup rpi4 as companion with pihawk 4 running v1.11 stable version firmware.

I have set optical flow which is reading giving readings. I have no GPS lock and I have set EKF2_AID_MASK to 2 which means it will use optical flow only and not GPS for position estimation.

I have written a offboard mode scripts that successfully changes mode to offboard and arming the drone. The setpoints are published and subscribed at appropriate rate {10 Hz}.

I am unable to figure out why after every 5-10 secs of interval my drone get disarmed . My offboard node is arming is again as it is written in that way. But, the root cause of disarming is unknown to me. Moreover system_status toggle between 3 and 4 {disarmed and armed}

Pls, someone share some knowledge on this.

@Ranjeet Can you share a log?

Usually drones get disarmed if they don’t take off after a predetermined amount of time. This could be what is hapenning to you.

Please check:

COM_DISARM_LAND

and

COM_DISARM_PRFLT

You can set them both as 0 for example as a test.

Hello @RicardoM17, the issue was with GPS. In Offboard mode, if GPS Lock is not there, it Arms and disarms repeatedly. I have checked this in open fields, when GPS lock is there, this behavior vanishes. The parameters that you mentioned to check are set to default and are okay.
As I asked in the post, I wanted to fly my drone without GPS lock and only with optical flow and distance sensor. I can see that I can disable the use of GPS in position estimation of drone but still GPS lock has to be there to not get the drone disarmed in Guided [OFFboard] mode.
I would love to listen if you or someone has flown in offboard without using GPS completely using LPE estimator group [we can toggle between EKF2 and LPE estimator for position/attitude estimation of the drone in PX4].

Thank you