GPS is not healthy with Airsim

Hi everyone,

I’m trying to simulate ardupilot with airsim simulation. I’ve installed an ubuntu 18.04 in my machine and I’ve installed all the prerequisites by Tools/environment_install/install-prereqs-ubuntu.sh script. I downloaded the binary “Blocks” from airsim main page.

Everything works fine but when I send a command to takeoff (for example), the console shows the next message:

APM: PreArm: GPS is not healthy

what is my mistake here???

thank you all

Hello

Yes I confirm, I have this APM: PreArm: GPS is not healthy error as well.
I reverted to 4.2 and it works ok

@rajat2004 are you still active on the dev ?

I’ve had frequent GPS not healthy errors before, but they generally clear after a few seconds, just initializing I guess. Haven’t kept myself up to date with exactly what changed in between, maybe the GPS checks got a bit more tighter?
I’ll try out the latest AP master and test, will post if there are any updates. But might take some time, potentially next week.

@ppoirier Yeah, still active, but less frequent since semester is going on and too much of stuff to do, mostly responding on some issues or small bug-fixes, rebasing old PRs, and some review stuff.
One possibility could be that AirSim follows a simpler conversion from NED<->GPS, this issue has some info and links, might be causing the problem.

OK I got it , The SITL directory has changed and we need to take the parameter file directly from default :

cd ardupilot/ArduCopter
…/Tools/autotest/sim_vehicle.py -v ArduCopter --console --map --add-param-file=…/Tools/autotest/default_params/airsim-quadX.parm

1 Like

well… no there is something deeper into this issue
for the moment , revert back to Copter-4.0

Or DISABLE ARMING CHECK :slight_smile:

1 Like

hello,how to DISABLE ARMING CHECK? thanks

@haoepng set param ARMING_CHECK to 0

@ppoirier did you find out what the issue was here?

for beginners (and I am one) the exact line is:
param set ARMING_CHECK 0

PS: Only use this in simulation, there is a reason for ARMING not to work and it needs to be found before a flight.

I debugged the code around AP_GPS::is_healthy() in Copter4.4 SITL with AirSim and it turned out that the state[instance].lagged_sample_count started to rise above 5 so the delay_ok param caused the not healthy flag. The solution is to raise the expected_lag in AP_GPS_Backend::check_new_itow, which can be done by changing the default airsim param of GPS_DELAY_MS in airsim-quadX.parm from 20 to e.g. 200 (this is what I got as lag in my case). This could be indeed a permanent change in the repo’s param file not to cause further errors for everyone…

1 Like