Board index FlightGear Development Scenery

LIRP improvement - Aircraft not aligned with runway

Questions and discussion about enhancing and populating the FlightGear world.

LIRP improvement - Aircraft not aligned with runway

Postby rockaffe » Tue Dec 10, 2013 12:45 am

Here I am with my daily problem... :)
Today I've done a test on my new improved (not so much at the moment...) LIRP airport but... here is how the aircraft stands on the runway(s). Obviously the issue is in also when aligning with the localizer for the landing.

Image

I've tried to modify the apt.dat file inserting the world editor coordinates but the aircraft were placed on the center of the runway(s).
So my questions are:

Is this the right procedure? (to modify apt.dat)
If yes how can i retrieve the right coordinates to place the aircraft?
Did this influence ILS also?

Thank you!
Working on LIRP ========> 40% ===================>100%
rockaffe
 
Posts: 23
Joined: Mon Dec 02, 2013 11:49 pm
Version: 2.8
OS: Mac OS X

Re: LIRP improvement - Aircraft not aligned with runway

Postby ludomotico » Tue Dec 10, 2013 1:19 am

rockaffe wrote in Tue Dec 10, 2013 12:45 am:Is this the right procedure? (to modify apt.dat)


You have two options: modifying apt.dat or creating a threshold file.

To modify apt.dat, you have to calculate the position of the center of the runway, the distance to the threshold and the exact heading.

I really prefer the second option: creating a threshold file. It is a file like this:

Code: Select all
<PropertyList>
  <runway>
    <threshold>
      <lon>-122.390710119498</lon>
      <lat>37.6252890402869</lat>
      <rwy>10R</rwy>
      <hdg-deg>117.91</hdg-deg>
      <displ-m>0</displ-m>
      <stopw-m>0</stopw-m>
    </threshold>
    <threshold>
      <lon>-122.358342836439</lon>
      <lat>37.6117087495669</lat>
      <rwy>28L</rwy>
      <hdg-deg>297.91</hdg-deg>
      <displ-m>0</displ-m>
      <stopw-m>76</stopw-m>
    </threshold>
  </runway>
</PropertyList>


Change position and headings according to your runway. You must save this file in FGROOT/Scenery/Airports/L/I/R/LIPR.threshold.xml

Keep in mind that with this method you cannot create a new runway, only modify runways already defined in the apt.dat. If you need to create a new runway, the only option is modifying apt.dat

Did this influence ILS also?


Did it? You will find the position of the ILS in FGROOT/Navaids/nav.dat.
User avatar
ludomotico
 
Posts: 1002
Joined: Tue Apr 24, 2012 1:01 pm
Version: git
OS: Debian GNU/Linux

Re: LIRP improvement - Aircraft not aligned with runway

Postby rockaffe » Tue Dec 10, 2013 1:39 am

Thank you Ludomotico!

Just 2 questions:

how can I calculate the position? My guess was to place an object and retrieve the coordinates from the log file, but maybe a easiest solution exists...
If I made that file I only need to put it in the appropriate folder and nothing else?

Thank you again!
Working on LIRP ========> 40% ===================>100%
rockaffe
 
Posts: 23
Joined: Mon Dec 02, 2013 11:49 pm
Version: 2.8
OS: Mac OS X

Re: LIRP improvement - Aircraft not aligned with runway

Postby ludomotico » Tue Dec 10, 2013 9:07 am

If you have improved LIPR using WED, just use the position and heading of the two thresholds that WED shows in the properties of the runway. Then, set this position in the file threshold.xml and save in the appropriate folder. That's it.

Warning: you can only use LIPR.threshold.xml if the name of the runway is the same than the name in apt.dat. You cannot create new runways or modify the name of old runways using this method!
User avatar
ludomotico
 
Posts: 1002
Joined: Tue Apr 24, 2012 1:01 pm
Version: git
OS: Debian GNU/Linux

Re: LIRP improvement - Aircraft not aligned with runway

Postby fmg » Tue Dec 10, 2013 10:34 am

Or just take the ufo, go to the right position and take the coordinats and heading from the HUD or the properties.
User avatar
fmg
 
Posts: 506
Joined: Tue Jun 29, 2010 5:13 pm
Location: EDDI
Callsign: fotomas
Version: 2
OS: Mac OS X 10.6.8

Re: LIRP improvement - Aircraft not aligned with runway

Postby ludomotico » Tue Dec 10, 2013 12:07 pm

fmg wrote in Tue Dec 10, 2013 10:34 am:Or just take the ufo, go to the right position and take the coordinats and heading from the HUD or the properties.


I'm afraid it won't be accurate enough. A deviation of a quarter degree in heading, or a tenth degree in latitude/longitude, will put the aircraft out of the runway in no time. Looking at the position of the threshold reported by WED is the best option since it will be exactly the real thing, especially if the OP is enhancing the layout of the airport.

If you don't care about accurateness, I'd prefer using parking positions and pushing the pilot to align manually on the runway. But if you provide fast spawn positions at a runway, I expect them to be completely accurate up to the last decimal.

Of course, this is only my opinion. In fact, I always use parking positions :)
User avatar
ludomotico
 
Posts: 1002
Joined: Tue Apr 24, 2012 1:01 pm
Version: git
OS: Debian GNU/Linux

Re: LIRP improvement - Aircraft not aligned with runway

Postby rockaffe » Tue Dec 10, 2013 1:08 pm

Thank you guys!
I've done as ludomotico suggests: take the wed data and now all works fine. Btw I'm about to use parking as well for the finished airport :)
Working on LIRP ========> 40% ===================>100%
rockaffe
 
Posts: 23
Joined: Mon Dec 02, 2013 11:49 pm
Version: 2.8
OS: Mac OS X

Re: LIRP improvement - Aircraft not aligned with runway

Postby ludomotico » Tue Dec 10, 2013 1:23 pm

I also set the parking positions using WED and then run a Python script to automatically convert them to FlightGear. If you are interested, I'll submit the script in a few hours when at home.
User avatar
ludomotico
 
Posts: 1002
Joined: Tue Apr 24, 2012 1:01 pm
Version: git
OS: Debian GNU/Linux

Re: LIRP improvement - Aircraft not aligned with runway

Postby rockaffe » Tue Dec 10, 2013 2:56 pm

ludomotico wrote in Tue Dec 10, 2013 1:23 pm:I also set the parking positions using WED and then run a Python script to automatically convert them to FlightGear. If you are interested, I'll submit the script in a few hours when at home.


You'd be very kind :) Thank you!
Working on LIRP ========> 40% ===================>100%
rockaffe
 
Posts: 23
Joined: Mon Dec 02, 2013 11:49 pm
Version: 2.8
OS: Mac OS X

Re: LIRP improvement - Aircraft not aligned with runway

Postby ludomotico » Sun Dec 15, 2013 12:09 am

Oh, I forgot about this post. My apologies.

Code: Select all
#!/usr/bin/python
# -*- coding: utf-8 -*-

import sys

infile = open(sys.argv[1], 'r')

airport = sys.argv[2]

found = False

for line in infile:
        line = line.strip()
        # 1 for airports, 16 for seaports
        if line.startswith("1 ") or line.startswith("16 "):
                if " %s "%airport in line:
                        found = True
                        break

if not found:
        print("Airport not found")
        sys.exit(1)

# Here, we are at the airport

import re
# There are two lines that describe parkings: line 15 and line 1300
pattern15 = re.compile(r"^15\s*([\-0-9\.]*)\s*([\-0-9\.]*)\s*([\-0-9\.]*)\s*(.*)$")
pattern1300 = re.compile(r"^1300\s*([\-0-9\.]*)\s*([\-0-9\.]*)\s*([\-0-9\.]*)\s*(\w*)\s*([\w|]*)\s*(.*)$")
                                                                                                                                                               
parkings = []                                                                                                                                                   
for line in infile:                                                                                                                                             
        line = line.strip()                                                                                                                                     
        # If the airport description ends, break                                                                                                               
        if line.startswith("1 "):                                                                                                                               
                break                                                                                                                                           
                                                                                                                                                               
        lat = -555                                                                                                                                             
        lon = -555
        heading = 0
        result = pattern15.match(line)
        # Math line 15
        if result:
                lat = float(result.group(1))
                lon = float(result.group(2))
                heading = float(result.group(3))
                name = result.group(4).replace(' ', '_')
        # Match line 1300
        else:
                result = pattern1300.match(line)
                if result:
                        lat = float(result.group(1))
                        lon = float(result.group(2))
                        heading = float(result.group(3))
                        # group 4 has the type of aircraft and group 5 is services available at the parking
                        name = result.group(6).replace(' ', '_')
        # If found, convert values
        if lat != -555:
                if lat < 0:
                        lat2 = "S%d %f"%(int(abs(lat)), (abs(lat) - int(abs(lat)) )* 60)
                else:
                        lat2 = "N%d %f"%(int(abs(lat)), (abs(lat) - int(abs(lat)) )* 60)
                if lon < 0:
                        lon2 = "W%d %f"%(int(abs(lon)), (abs(lon) - int(abs(lon)) )* 60)
                else:
                        lon2 = "E%d %f"%(int(abs(lon)), (abs(lon) - int(abs(lon)) )* 60)
                parkings.append((lat2, lon2, heading, name),)

infile.close()

i = 0
print('<?xml version="1.0"?>\n<groundnet>\n    <parkingList>')
for p in parkings:
        print('        <Parking index="%d" type="gate" name="%s" lat="%s" lon="%s" heading="%f" />'%(i, p[3], p[0], p[1], p[2]))
        i = i + 1
print("</parkingList>\n</groundnet>")



This is a very simple python script to convert parkings in WED to parkings in FlightGear. Usage: position your parkings in WED, including their names: 1, 2, 3, GA1... and export the airport to YOURAPT.DAT. Then, run:

python make_parkings.py YOURAPT.DAT ICAO

The output can be directly saved into FG_ROOT/Airport/I/C/A/ICAO.groundnet.xml

For example: python make_parkings.py apt.dat LIRP > $FG_ROOT/L/I/R/LIRP.groundnet.xml

Next time you refresh the list of airports in fgrun, your parkings should be available.
User avatar
ludomotico
 
Posts: 1002
Joined: Tue Apr 24, 2012 1:01 pm
Version: git
OS: Debian GNU/Linux

Re: LIRP improvement - Aircraft not aligned with runway

Postby rockaffe » Mon Jan 06, 2014 2:25 pm

Thank you very much ludomotico! I'm sorry if I reply only today but I've never logged in until today :)
Working on LIRP ========> 40% ===================>100%
rockaffe
 
Posts: 23
Joined: Mon Dec 02, 2013 11:49 pm
Version: 2.8
OS: Mac OS X


Return to Scenery

Who is online

Users browsing this forum: No registered users and 7 guests