• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Touchdown detection

Messages
1
Country
denmark
Hi,

I am new to the simconnect world - I am trying to write a small application that will :

1. detect touchdown
2. detect which airport - if any - the plane has landed in.

Part 1. is fairly easy, but part 2. is a bit more tricky. As I did not find an API way of getting the airport info, I thought of comparing the plane position with all possible airport locations. This would get me the nearest airport, but no indication of wether a nearby field was used instead ! - is there somewhere in the API to query the surface type of what the wheels are touching ?

thanks,
Peter
 
2. detect which airport - if any - the plane has landed in.

is there somewhere in the API to query the surface type of what the wheels are touching ?

Hi Peter,

No, as far as I know. But as you know your touchdown location and the rwy coordinates, length and width, you can use any of the inside a polygon algorithms to determine if you have landed inside the runway or... well... close to it :D

Best Regards,
Javier.
 
is there somewhere in the API to query the surface type of what the wheels are touching ?

Request simulation variable "SURFACE TYPE" it's an enum. see "Simulation Variables" in the SDK for meaning (0 = concrete, 1 = grass etc). Use "SIM ON GROUND" to detect touchdown.

I don't know how to get the nearest airport. You can probably do it with the gps, but unfortunately you cannot request gps variables in simconnect programs, only in gauges or FS modules :confused:
 
EDIT:

Wow, beat me to it while I was double checking. Well done.



For part one, you have several options.

You can test for PLANE ALT ABOVE GROUND which is a bit crude, so SimConnect provides you with a more graceful SIM ON GROUND, which is a simple bool test. Call it, if true, then you are on the ground.

For your second point, you have SURFACE TYPE, which looks a bit like this:

SURFACE TYPE
Type of surface:
Enum
0 = Concrete
1 = Grass
2 = Water
3 = Grass_bumpy
4 = Asphalt
5 = Short_grass
6 = Long_grass
7 = Hard_turf
8 = Snow
9 = Ice
10 = Urban
11 = Forest
12 = Dirt
13 = Coral
14 = Gravel
15 = Oil_treated
16 = Steel_mats
17 = Bituminus
18 = Brick
19 = Macadam
20 = Planks
21 = Sand
22 = Shale
23 = Tarmac


I suppose it shouldn't be too difficult to figure out which of those are airports (or specifically runways) and which aren't.

As stated before, you'd have to use something like the latlong to figure out airport, unless if they have an airport selected for approach in GPS or a flight plan, and that can't always be counted on.
 
I suppose it shouldn't be too difficult to figure out which of those are airports (or specifically runways) and which aren't.

I made some experiments with this variable and it is not runway specific. I mean, you can find the same surface type for the runway and for the surrondings.

Best Regards,
Javier.
 
I made some experiments with this variable and it is not runway specific. I mean, you can find the same surface type for the runway and for the surrondings.

Best Regards,
Javier.

That's interesting. I didn't think they'd get that specific with things like asphalt and concrete, but I guess that would match roads or other things you could land on.
 
That's interesting. I didn't think they'd get that specific with things like asphalt and concrete, but I guess that would match roads or other things you could land on.

Exactly. You can find, in the same airport, concrete on the runway, on the taxiways, on the parking... so not very reliable to know if you have landed where you are supposed to do.

What is interesting about this variable is that you get the right value even when you are flying.

I think roads are urban type but not fully sure.

Javier.
 
Back
Top