Failsafe: Terrain Data Missing - When using rangefinder

We are flying with ArduCopter 4.2.1 installed. TERRAIN_ENABLE = 0. WPNAV_RFND_USE = 1. We take of in auto and then get the message: FAILSAFE: Terrain Data Missing. We use a radar rangefinder that works very reliably. We have tested it and have the logs showing that the measurement is accurate and good. Range finder settings are:

Our target altitude is 30 m above ground, so well within the rangefinder settings. The rangefinder is working reliably at the 30 m altitude mark.

We can fly and perform terrain follow with TERRAIN_ENABLE = 1 when we have the relevant STRM data. When we remove the data and set TERRAIN_ENABLE = 0, we get the error.

Similar issues has been reported in the past. Notably in 2020. None has a resolution for this issue. Is this a bug?

Hello @hbrenkman

It is better to send a log file to better evaluate this.

Maybe the status of your rangefinder is not healthy when you are engaging in Auto Mode.

Bruno, it tells me the file is too large to upload here. I placed it in Google Docs. Here is the link: Google Drive: Sign-in

Let me know if that did not work and I will make another plan. This log is typical of what we see. The drone takes off, then fail save and RTL.
Here is the parameter file:

param.param (18.5 KB)

This is the flight plan we used for testing:

1 Like

Hello @hbrenkman

I requested access to download your log in Google Drive.

By your parameter list, I saw that you are using a DroneCAN Rangefinder (RNGFND1_TYPE = 24). I am not super into this sensor, but have you properly configured your CAN parameters?

That rangedfinder has been working properly as far as I can tell. The log shows plots of its performance.

Below is the rangefinder plot from the log I posted in the previous item:

from this you can see that the readout looks good (at least to me). The drone takes off and then when it is about at altitude, 35 m as per flight plan, it goes into RTL with the Fail Save: Terrain Data Missing.

It seems that this problem is similar to my issue 2 years ago. See Copter: Rangefinder and Terrain Frame: AUTO fails to takeoff but disarms again · Issue #14957 · ArduPilot/ardupilot · GitHub

This issue was never resolved.

Check this out, I have just plotted your Rangefinder Status along the distance, and check out how many “No Data” reports (status = 1) your rangefinder driver is reporting:

But anyway, I don’t believe this is the root cause, despite of being strange. The failsafe is triggered when the drone starts wp navigation, so I think this is related to terrain databases. Check your SD card, it should have a folder named “TERRAIN”. Erase all the files inside it and try again. Maybe your system is trying to retrieve terrain database for that region in this folder, not finding anything and retrieving the error. This could explain why your takeoff by terrain coordinates are successful but navigation triggers the failsafe. Also double check that you have parameter TERRAIN_ENABLE set to zero.

You can also generate the terrain data here and put it on the SD Card before going out into the field

Thank you Bruno. We have deleted the terrain data file for the test that I shared. I have noticed periodic “No Data” reports. But am not sure why that is happening. We send a range signal to the flight controller every 200 ms (adjustable). Perhaps it is looking for a data point at shorter intervals? Would that be a possibility?

Our objective is to fly without terrain data using a rangefinder sensor.

Thank you. Seems like we will have to get our edge computer to handle the terrain following as all posts I have checked out since about 2016 showed no solution.

That’s pretty strange. Maybe formatting the SD Card could help?

I had a similar trouble years ago, but really do not remember how we managed this, simply came back to proper work.

Really not sure about it, but I think this interval is too slow for it. If I remember well, 200ms is the interval that ardupilot interprets as no data for the rangefinders, so try to send it faster, at least 50ms interval (20Hz) would be nice and would clear all these “no data” statuses.

1 Like

Just out of curiosity, what radar altimeter are you using?
We flew with the CAN Ainstein US-D1 a month ago.
It was generally good, but unfortunately below ~30cm the reading would jump to between 230 and 270cm.
(Ours was mounted such that it was directly on the ground when landed so it caused issues with the aircraft being unsure that it had in fact landed.)
We would have preferred a nonsense number when below 30cm rather than a reasonable (but wrong) number within the 50cm to 4500cm range.

We use an of-the-shelf radar sensor and wrote the code that deserialize the feed and then send it over a CANBUS to the flight controller.