ardupilot_wiki icon indicating copy to clipboard operation
ardupilot_wiki copied to clipboard

Plane: disable gps during flying and in the specific conditions

Open John-Mccarty opened this issue 2 years ago • 3 comments

hi I want to stopping using gps during flying in some conditions : "if sat count under the 10 , if the control mode is auto or rtl , if the plane is arming and if the gps hdop error is too high". I am doing it inside Arduplane.cpp file with force_disable function and its stop using gps and make its status to no_fix but after that it doens`t getting using gps even in the all condiotions.How can i do stop using gps just in the conditions of above?

John-Mccarty avatar May 09 '22 13:05 John-Mccarty

Hi @John-Mccarty,

I think you could use a Lua script if the autopilot you're using has a high powered CPU (like an H7 on the CubeOrange, Durandal, etc).

The detection of the GPS state could be done as it is done in this script that I wrote recently. https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_Scripting/examples/copter-deadreckon-home.lua

Then the AHRS::set_posvelyaw_source_set() could be used to change the EK3_SRCx_POSXY/VELXY to not use the GPS.

rmackay9 avatar May 10 '22 00:05 rmackay9

Ah, this issue was raised on the wiki issues list. This should really be on the main flight code issue list or raised in the forums.

rmackay9 avatar May 10 '22 01:05 rmackay9

Thanks for the response.I tried to change to ekf_source to set_posvelyaw_source to camera it doesnt effect until I disable gps when I disable gps then it automaticly switch the other source(camera).and I am using the latest firmware and t265 camera with vio

John-Mccarty avatar May 13 '22 05:05 John-Mccarty

aux switch available for this...closing

Hwurzburg avatar Nov 30 '23 14:11 Hwurzburg