dharmab / skyeye

AI Powered GCI Bot for DCS
MIT License
42 stars 9 forks source link

Filter out aircraft below an AGL threshold #65

Open dharmab opened 1 month ago

dharmab commented 1 month ago

Currently we use a 50 knot speed filter to remove parked aircraft. However this also removes slow-flying helicopters that should logically be visible because of their large rotating rotors.

Tacview does not seem to consistently export AGL data from DCS World, so we'll need to build elevation maps and compare them to each contact's MSL altitude. The orb library has a subpackage for working with elevation map tiles, so once we get the data out of DCS we can use standard GIS techniques for this.

If an elevation map is not available, fall back on the speed filter.

dharmab commented 3 weeks ago

Building the elevation maps will likely be a spinoff project in a separate Git repo.

  1. Modify DCS to allow the scripting engine to write files (This is a common temp change that tools like Retribution and Web Editor will make)
  2. Create a Lua script that uses DCS_func_getHeight to sample many points across a map. Write the samples to a file.
  3. Load that file into another program and transform it into a Cloud Optimized GeoTIFF. This is the same format USGS uses for elevation maps, and it has some cool features, such as being able to read specific areas of the map across a network without having to download the full map.
  4. Publish the COGs for each terrain, e.g. as GitHub artifacts.

SkyEye could embed the maps if we can keep the total binary size under about 2GB. Otherwise, provide the elevation maps as a separate optional download.

The samples can be quite coarse for our purposes - e.g. sampling every 5m to a resolution of 1m is probably more than enough.

dharmab commented 3 weeks ago

Alternative TacView has an API to get elevation, which may be easier to work with. https://discord.com/channels/478955787268522018/809796004891197521/1266458113519653037

dharmab commented 2 weeks ago

Chatting with people on Discord, another way to do this would be to create a synthetic ACMI stream using dcs-grpc that includes the AGL data. Apparently there's code out there that can already do this to create redacted tacview data.