Error414/feature/inav terrain#11438
Error414/feature/inav terrain#11438error414 wants to merge 7 commits intoiNavFlight:maintenance-10.xfrom
Conversation
|
Test firmware build ready — commit Download firmware for PR #11438 228 targets built. Find your board's
|
f26cbdc to
b34e46e
Compare
|
Tested again with a H743. Now with the grid loading fix, it works well. |
e13d24b to
505c2d3
Compare
0437374 to
b4f054c
Compare
|
Definitely looks interesting. Rather than modifying each and every target individually, would it make sense to do something like: |
|
you are right, it would be better, I will do it as you said |
|
I tried to add it to src/main/target/common.h, but I have no idea how to do that. I would need check if FC has SD card and Baro, but common.h file is loaded before target.h so there is not information about target. the order common.h -> platform.h -> FC_TARGET_NAME/target.h Do you see any solution? |
Terrain AGL
Terrain is a system that can show AGL (Above Ground Level) in the "distance" OSD element. It loads pre-generated data from an SD card and uses GPS data and barometric altitude for AGL calculation.
Features
Limitations
Technical details
Terrain uses two tasks: an IO task and a GPS task.
The GPS task reads GPS data and creates requests for the IO task. The IO task reads requests from cache and loads grid data into cache.
The two-task design is needed because AGL data must already be loaded in cache by the time it is requested. In some conditions, AGL data requests should stop, but the IO task must keep running to close files and directories, free memory, and release the blackbox lock.
The IO task needs approximately 10 cycles to load data from the SD card. Task frequency can be adjusted to reduce gaps in the blackbox log.
Protection
When arming, the system checks whether the SD card can be read. If the read fails due to a faulty SD card or missing grid data, the terrain system is disabled for the entire flight. This prevents the first SD card read from happening mid-flight.
Testing
I tested it for few months on two planes
Hewing T1, MatekH743Wlite (blackbox on)
Hewing T2, MatekH743Wlite + dedicated rangerfinder NRA15 (blackbox on)
other testers
Hewing T1, SpeedyBeeF4Wing (blackbox on)
Beluga, SpeedyBeeF4Wing
For testers
Documentation:
https://github.com/error414/inav/blob/4fb0fdb9e28d899f03293d34b60907cadd1dbd2b/docs/Terrain.md
Use configuratior:
https://github.com/iNavFlight/inav-configurator/tree/maintenance-10.x