Board index FlightGear Development AI Traffic

AI scenery: C172 in touch&gos pattern

Intelligent, computer controlled vehicles that drive/fly over the planet!

AI scenery: C172 in touch&gos pattern

Postby rleibner » Thu Feb 18, 2021 7:35 pm

The idea is simple: to animate a little airport with a C172 practicing touch-and-go patterns in a endless loop.
Sounds easy ... at least that's what i thought.
After reading the wiki and carefully calculated the waypoints, my flightplan begins as:
Code: Select all
<?xml version="1.0"?>
<!-- Touch and Go on SUAA, Rwy 19 -->
 
<PropertyList>
 <flightplan>

  <wpt>
   <name>final</name> 
   <lat>-34.700335</lat>
   <lon>-56.271181</lon>
   <alt>500.0</alt>
   <ktas>80</ktas>
   <flaps-down>0.3333</flaps-down>
  </wpt>

  <wpt>
   <name>flare</name> 
   <lat>-34.782931</lat>
   <lon>-56.265361</lon>
   <alt>160.0</alt>
   <ktas>75</ktas>
   <flaps-down>0.6666</flaps-down>
  </wpt>

  <wpt>
   <name>touch</name>
   <lat>-34.78338</lat>
   <lon>-56.26533</lon>
   <alt>148.0</alt>
   <ktas>75</ktas>
   <flaps-down>0.0</flaps-down>
  </wpt>
 
...


and a short my_demo.xml pointing to it.
Well, ... it doesn't work.
The plane approaches nicely along the final leg, but almost arriving the "flare" waypoint she suddenly turns and escapes climbing in a perpendicular heading !!! :shock:
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 269
Joined: Fri May 19, 2017 8:17 pm
Location: Uruguay - SUMU
Callsign: CX-BEX
Version: next
OS: Ubuntu 18.04.4

Re: AI scenery: C172 in touch&gos pattern

Postby wlbragg » Thu Feb 18, 2021 8:21 pm

I actually did this at KEQA airport. It's not perfect using an AI scenario. You find the interpolation of way-points, both position and altitude need massaging.

Here is my FlightPlan. I used the AI Cub.

This a backup and it's possible my working code has changed, I don't know if updated my backup. I can't get to the working copy at the moment, But this should get you close.

Code: Select all
<?xml version="1.0"?>

<PropertyList>
   <scenario>
      <name>KEQA Cub Touch-n-Go</name>
      <description>
         This scenario runs a touch-n-go at El Dorado KEQA Captain Jack Airport.
         Wayne Bragg
      </description>
      <entry>
         <type>aircraft</type>
         <model>Aircraft/Cub/Models/Cub-ai.xml</model>
         <name>Cub</name>
         <flightplan>KEQA_22_cubtouchngo.xml</flightplan>
         <repeat>1</repeat>    
      </entry>
   </scenario>
</PropertyList>


Code: Select all
<?xml version="1.0"?>

<PropertyList>

<flightplan>
    <wpt>
        <name>one</name>
        <lat>37.80494297358305</lat>
        <lon>-96.83246943194117</lon>
        <alt>1500</alt>
        <ktas>120</ktas>
        <gear-down>true</gear-down>
    </wpt>
    <wpt>
        <name>two</name>
        <lat>37.78413292883169</lat>
        <lon>-96.82224528849559</lon>
        <alt>960</alt>
        <ktas>90</ktas>
        <gear-down>true</gear-down>
    </wpt>
    <wpt>
        <name>three</name>
        <lat>37.77777702744584</lat>
        <lon>-96.81913154583537</lon>
        <alt>1370</alt>
        <ktas>60</ktas>
        <gear-down>true</gear-down>
    </wpt>
    <wpt>
        <name>four</name>
        <lat>37.77339478122629</lat>
        <lon>-96.81696978490558</lon>
        <alt>1500</alt>
        <ktas>70</ktas>
        <gear-down>true</gear-down>
    </wpt>
   <wpt>
        <name>five</name>
        <lat>37.75776276867127</lat>
        <lon>-96.80921750074822</lon>
        <alt>1700</alt>
        <ktas>90</ktas>
        <gear-down>true</gear-down>
    </wpt>
   <wpt>
        <name>END</name>
        <lat>37.74160191631262</lat>
        <lon>-96.80138647887906</lon>
        <alt>2200</alt>
        <ktas>120</ktas>
        <gear-down>true</gear-down>
    </wpt>
<wpt>
  <name>EOF</name>
</wpt>

</flightplan>

</PropertyList>
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7587
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: AI scenery: C172 in touch&gos pattern

Postby rleibner » Fri Feb 19, 2021 11:42 pm

wlbragg wrote in Thu Feb 18, 2021 8:21 pm:I actually did this at KEQA airport. ...

Your flightplan is similar to mine.
I tried with a lot of intermediate waypoints (each about 0.3nm far from the other) but it does not work for me.
It seems that AI refuses to fly over the airport: after going around, she goes to the crosswind leg, downwind and final, but always avoiding the runway.
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 269
Joined: Fri May 19, 2017 8:17 pm
Location: Uruguay - SUMU
Callsign: CX-BEX
Version: next
OS: Ubuntu 18.04.4


Return to AI Traffic

Who is online

Users browsing this forum: No registered users and 4 guests