Mimic RCx_Option = 65 (GPS Disable) in a script / Delay setting the Origin

Using EKF3. Current system is setup to use an RC switch to ensure GPS is disabled on startup. When the switch is thrown GPS is enabled and approximately ten seconds later the Origin is set.

Trying to find a way to mimic that functionality using a script. Any ideas on parameters to change via the script or other script specific functions that would do this are greatly appreciated.

The real goal is to have GPS active and getting a solid 3D fix for a time before enabling data flow to the EKF3 processor. I have found that despite the GPS indicating good 3D lock it takes another minute or two of warming up to get a good altitude number and by that time the incorrect origin altitude has already been established.

I wonder if altering the EK3_SRC parameters via script might do it? Maybe only enabling the GPS source once HDOP and/or VDOP decrease to some acceptable value?

But there are also ahrs:set_home() and ahrs:set_origin() bindings that may prove even more useful than what amounts to a workaround.

Thanks for the ideas.

I have been able to use ahrs:set_home() to update the home point but ahrs:set_origin() does not seem to work, reporting that it can not be changed. Maybe there are some other parameters that need to be set a certain way before ahrs:set_origin() will work.

I have been changing the EK3_SRC1_POSZ settings so as to not create altitude confusion during the warm up process. Based on your suggestion I changed the others (EK3_SRC1_POSXY, _VELXY, and VELZ) to 1 to see if that prevents the origin from being set. Unfortunately, it does not.

I should think that setting all EK3_SRCn_POSXY and EK3_SRCn_POSZ params to zero would keep an origin from being set.

It looks like the set_origin() binding is there primarily to assist with non-GPS vehicles, so it probably won’t help in this situation.

I wonder if setting EK3_GPS_CHECK to 255 might be the proper way to do this?