It would be a great feature to be able to use the geofencing feature using terrain altitude.
Why? Because every regulation I know of (FAA Part 107, EU 2019/945, EU 2019/947) defines the maximum allowable altitude above ground. In flat areas this is not an issue, but if I want to fly up a mountain, I can legally do this, but the current implementation of geofencing would limit me to the set altitude above takeoff. This is why I currently don´t have fence enabled, but would like to in order not to accidentally fly too high.
This would be a great improvement regarding compliance with various regulations. Of course there would have to be some sort of prearm check for terrain data (if there isn´t already) and the user would have to set RTL_ALT_TYPE to 1 (Terrain) to not automatically fly outside the fence in case of a breach in the above example.
I think that it is a pretty straightforward implementation, but have some safety issues associated with this, like knowing what to do when you lose rangefinder data for instance, you have breached the fence or not?
This for instance can switch to relative altitude if rangefinder data is not healthy…
I was thinking about using this feature with the terrain database provided by the GCS.
However in both cases (if the rangefinder data was unhelathy or if there is no terrain data) I would revert back to relative altitude.
I don’t think they will have the required resolution for the application… but anyway, this is a feasible implementation.
There are significantly better DEM (even including manmade structures) than SRTM3. Where I live we have 1m DTM publicly available for example.
We also have a at least 5m DEM and DSM publicly available in the whole country and some states even have 1m resolution. I have downscaled these to 30m and feed this to my UAVs through MissionPlanner and have a very good experience with terrain following (much better than with lidar due to vegetation, etc.) even around high mountain peaks. I regularly do photogrammetry missions on mountains in terrain frame.
However I’d say, that the standard resolution of the 100m SRTM data would be fine for a fence.
I’d be interested in the opinion of some devs like @rmackay9 @tridge.
One small problem with using smaller scale DEM is that it doesn’t reasonably guarantee compliance with aviation regulations. Assuming 100m grid height average DEM and a sharp valley aligned to the grid expected error reaches 30m (typical separation between manned and unmanned assigned airspace) at 31° slope which I wouldn’t call extreme in mountains. It is noticeably worse if we use maximum height DEM better suited for terrain avoidance reaching 30m error at 17°.
IMO at such resolution you would need 2 DEM with minimum and maximum height in each square accounted for to have both terrain avoidance and regulatory compliance. And no fly areas (negative flight height range) would crop up lot in mountainous terrain.
I would say that 10-15m DEM is around where diminishing returns start to get you in mountainous terrain though that level of resolution is probably not needed on flatlands.
I have been pointed to discussion by someone else after posing a question how to stay within the limits of the above mentioned EU regulations. I have read the corresponding articles and I will cite them here:
(2) Where the UAS operation involves the flight of the unmanned aircraft starting from a natural elevation in the terrain or over terrain with natural elevations, the unmanned aircraft shall be maintained within 120 metres from the closest point of the surface of the earth. The measurement of distances shall be adapted accordingly to the geographical characteristics of the terrain, such as plains, hills, mountains.
(4) By way of derogation from point (2), unmanned sailplanes with a MTOM, including payload, of less than 10 kg, may be flown at a distance in excess of 120 metres from the closest point of the surface of the earth, provided that the unmanned sailplane is not flown at a height greater than 120 metres above the remote pilot at any time.
I don’t know what FAA says, but the above EU rules cannot be easily transferred to an adaptable geofence. The limit defined by these rules do not correspond to 120 m above terrain. However 120 m above terrain is a lower limit of it.
My approach to this problem goes via LUA script. I implemented a script that sends warnings as long as you fly above 120 m above terrain. Then it is up to the pilot to react.
Yeah you are right, as being the lower limit it does comply with regulations.
I’ve done the warning with Missionplanner and on my Transmitter, but it’s only an acoustic warning and is not “enforced”.