" PreArm: Waiting for Terrain Data " I couldn't get rid of the error

@kalai1219,

I think it loads terrain data for about 2km around the home position. It also loads the terrain for any waypoints in the auto mode mission.

Normally once the terrain data has been loaded to the autopilot (e.g. terr_pend = 0) it won’t need to load more during the flight. It depends upon where the vehicle flies to. Still, not having the terrain data should only cause problems if you’re running an auto mode mission with the altitude frame for the commands set to “Terrain”… or if you trigger RTL mode and the RTL_ALT_TYPE = 1 (Terrain).

1 Like

@xfacta Thank you for your valuable information. I did a compass calibration indoors. However, I have never calibrated outdoors. That’s why I did a compass calibration once outdoors.

@rmackay9 Thank you for your valuable information. Outside, the autopilot receives the terrain data from the ground station. The error is lost. However, it occasionally gives the same error when outdoors. It disappears immediately. After flying in GPS mode, it gives the same error even in Stabilized Mode indoors. At the moment, I have uploaded the land data of the whole country (Turkey) to the SD card. But the error is still not fixed.
.
I’m glad to hear that you will take care of the error. Thank you.
.
NOTE: Also, I don’t know if it has anything to do with the error, but I am connecting with Autopilot via wifi module. In other words, there is no internet connection at the ground station at that time. Then I give internet to the ground station and it receives the land data. Then I connect to Autopilot again. The terrain data (DAT file) is being uploaded to autopilot. Error is fixed. But indoors, it gives the same error in stabilized mode. In addition, the SD card has all the country’s terrain data.

I see - that’s good.
I’ve seen where people think they have t calibrate the compass at the start of each flying session, and it’s not required.

2 Likes

Confirmed: I currently have PreArm waiting for terrain data after installing arduplane 4.3.4 stable as well as a PreArm: AHRS: not using configured AHRS type error.

ARMING checks do not have a “terrain data” check to disable as part of the Pre Arm procedure.

ter_pend is 57 and not moving
ter_load is 335

I have a TERRAIN folder on the SD card and I deleted the 3MB worth of .DAT that was in there. Rebooted the autopilot and reconnected to my desktop (via USB cable). Same pend and load numbers as above. I expected those to go to zero but maybe its reading the .DAT files on my desktop??

I read through the entire thread here and I’m thinking it is a bug its just not fixed as of 4.3.4.

BTW: My last bird ran into a guy wire and destroyed itself. Terrain following was not able to be turned on (could not arm) and I had to guess as to how high the tower was, turns out it was higher than 300 feet.

Bad day all around that day.

@Chad_Frazer get well soon

@rmackay9

I too facing randomly prearm: waiting for terrain data in open outdoor area with good gps position a d terrain radar working normally.

Mission set with altitude type as terrain.but i couldn’t arm the drone in Loiter mode.i think this issue is not yet solved?

If i change the mission altitude type as Relative then the error goes away.
I have checked all the above suggestions given in the topic from day it started.

Maybe :thinking: worth a ArduCopter 4.4.0-beta4 update and a re-test?

@kalai1219,

This pre-arm warning means that the autopilot has not received the terrain data (from the ground station) for the vehicle’s current location or the location of some waypoints in the mission.

The autopilot may not have all the required terrain database because the ground station isn’t supplying it. The ground station may need an internet connection in order to get the data from whatever mapping source it is using.

MP’s status screen also shows the status of the terrain data including the terr_pending value which shows how many areas the autopilot is waiting for. Monitoring this can help determine if the ground station is failing to provide data or whether it will just take a bit more time.

I don’t think there are any bugs in the AP flight code in this area.

2 Likes

So if GCS is no way unable to connect with internet ( may be no internet coverage area or no source of internet).
In this situation how this error should overcome?

Terrain data already loaded to the FC SD card?

1 Like

You can pre-load the SD card with terrain data either by loading a mission for your site (even if you don’t plan to fly the ission) or by using the terrain tool:

https://terrain.ardupilot.org/

Either way you won’t need internet data on site.

https://ardupilot.org/copter/docs/terrain-following.html#sources-of-terrain-data

4 Likes

Great advice from @Allister although I must say that personally I have never tried to load the SD card with terrain data directly, I always just go via the GCS. By the way, there’s a “Terrain Version” drop-down and it would be good to make sure that the selection matches the TERRAIN_SPACING parameter.

It may be that if you pre-fetch the map in the ground station that it also download the SRTM data so that the GCS has it available if the autopilot asks for it.

1 Like

the same method i have followed with now and still issue not resolved.
FC connected via USB cable and mission planner GCS used with well internet connection.
in status tab there is no TERRAIN pending data. waypoint uploaded with altitude source as terrain.
still PREARM error : Waiting for terrain data.

@rmackay9 your opinion on this?

@rmackay9 @Allister @xfacta any one view on this to come out of this issue?

Have you tried the method I suggested above? I understand it’s not the popular choice but I know it works.

@kalai1219,

I don’t think we’ve seen a log from you yet so it is a bit of a guess but here are some ideas:

  1. clear the mission and restart the autopilot to see if the message goes away. then add back the mission
  2. set WPNAV_RFND_USE = 0 so that the Auto mode terrain following uses the terrain database instead of the rangefinder.
  3. try clearing the terrain database files from the autopilot has shown on this issue.
  4. delete Mission Planner’s SRTM data and restart Mission Planner. I’m not sure exactly where these files are but somewhere on the PC’s hard drive.

Hope that helps and I’m interested to see if it resolves the issue.

hi @rmackay9
Today i was tried Reproduce the issue which i had 2 days back but i couldn’t reproduce it and prearm error was not appeared.
I was followed following steps to reproduce the issue.

  1. Made Terrain waypoint near home point using MP with internet connection.(NO prearm error)

2.Made terrain waypoint 100km away from home point using MP with internet connection (NO prearm error)

3.erasd all Terrain data in FC Sd card via MAVFtp on MP without internet connection then restarted FC all terrain data loaded without internet connection again No prearm error.

  1. repeated point 3 twice without internet connection to the MP but all terrain data loaded .

@Michael_Oborne as randy said old data stored in the MP file directory loaded the terrain data if yes where is that SRTM data file and how to delete those file to check i can able to reproduce the issue?

1 Like

I’m also having a “prearm: waiting for terrain data” issue.

There were no issues with 4.2.0 but today I upgraded to 4.4.0 and now I am getting this error. I downloaded the terrain files again and copied them to APM/TERRAIN but that didn’t help. I had to turn TERRAIN_ENABLE off to get it to arm (but I’d prefer to have the terrain following mode).

I use QGC but tried firing up Mission Planner (in case the terrain fetching helped resolve the issue) but that didn’t help either. Edit: I’ve also tried clearing the mission.

I see a tantalising snippet from on Google from the Discord channel about someone else having this issue upon upgrading to 4.4.0 but I can’t actually see the discussion if I follow the link.
image

After having tried a few older firmwares (inside the house), I noticed these “waiting for terrain data” messages started in 4.3.0, whereas 4.2.X were giving me “GPS waiting for home”.

So I tried 4.2.3, 4.3.0 and 4.4.0 outside and all three of them work and will arm. This is with TERRAIN_ENABLE=Enabled and RTL_ALT_TYPE=Terrain.

So it seems at least in my case, where the terrain data is already on the SD card, the “waiting for terrain data” is a furphy. Actually it seems to be an awkward way of saying it does not yet have a sufficient GPS fix.

I suspect that it tries to fetch terrain data for 0/0 area which fails due to the square not being near land and instead of seeing „waiting for GPS” you get that.

1 Like