Board index FlightGear Support Flying

Simple Circle Orbit for AI Flightplan

Controlling your aircraft, using the autopilot etc.

Re: Simple Circle Orbit for AI Flightplan

Postby Thorsten » Sat Aug 29, 2020 9:43 am

Finally, you obviously don't need to use any Nasal coding for this, you can also run the same computations "offline" and then use the results inside your XML flight plan.


That's where you're wrong... AI craft don't literally adhere to the specified flightplan, they try to interpret it in an 'intelligent' way - which basically prevents the idea of pre-recording a series of coordinates, putting it into xml and see it flown.
Thorsten
 
Posts: 11748
Joined: Mon Nov 02, 2009 8:33 am

Re: Simple Circle Orbit for AI Flightplan

Postby Hooray » Sat Aug 29, 2020 10:08 am

I think they're interpolating in between waypoints - so I don't see any reason why a coarse circular flight plan should not be flown adequately by computing ~10 offsets for a 36 waypoints arranged around the center of the circle.

That being said, the hard-coded AI system is certainly more and more becoming a legacy thing, like many contributors have repeatedly pointed out, using a scripted approach is very much superior - and even Durk himself has repeatedly summed up that there are far too many restrictions for it to be a viable foundation for the future:


http://wiki.flightgear.org/FGTraffic
After a couple of years of intense involvement, development of the AI traffic system came to quite a sudden halt after Durk's day job responsibilities had to take precedence. Durk has been very reluctant to pick up the pace again afterwards, because he's been in much doubt whether to continue with the existing code base or to restart from scratch.[3]


Durk is inclined to break away from the approach he took for the current AI Traffic system. The code has become too clunky too be maintainable, he will try to spend a limited portion of his development time for bug fixing the current code, but please don't expect any major changes any more. The new approach he has in mind should surpass everything we currently have, but it's going to take some time until it's all implemented. [4]


Obviously, there is no reason why we could not create a Nasal based replacement that still offers an XML interface, possibly even a compatible one - if that's what people want.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11977
Joined: Tue Mar 25, 2008 8:40 am

Re: Simple Circle Orbit for AI Flightplan

Postby Stevenj279 » Sun Aug 30, 2020 1:48 am

Gooneybird - Thanks...your example works and I'm putzing around a bit with it to see how much I can tweak it before breaking it... ;-)

A ui that would allow a user to punch in their orbit type (circular, racetrack, figure eight, even maybe a grid search pattern for SAR - land or maritime) might be of value to the community. If the code allows, also to select between fly over or fly by waypoints (though as a former Mission Planner, I never used fly by - I suspect helo ops would be more apt to use fly by, particularly if using NOE profile).
Williamsburg, VA
Win 7 Pro 64-bit, Intel Core i7-4700MQ 2.40 GHz
32 Gb Ram, 500 GB SSD, 2 TB SCSI HDD, NVIDIA GeForce GTX 780M
Stevenj279
 
Posts: 47
Joined: Fri Jul 24, 2020 12:26 am

Re: Simple Circle Orbit for AI Flightplan

Postby Thorsten » Sun Aug 30, 2020 6:09 am

I think they're interpolating in between waypoints


And since trying to implement the Shuttle landing as AI scenario, I know for a fact they do not interpolate between waypoints - I had an actual recorded set of waypoints as input, and the AI model did nothing like that - there's some performance constraints in the AI database, there's optimization to go to the nearest waypoint which makes circles complicated, there's lots of 'clever' stuff happening - so I see plenty of reasons why a circular flight plan should not be flown adequately, because I actually tried that and it is not flown adequately...
Thorsten
 
Posts: 11748
Joined: Mon Nov 02, 2009 8:33 am

Re: Simple Circle Orbit for AI Flightplan

Postby Hooray » Sun Aug 30, 2020 8:40 am

I haven't looked at the code in question in years, so you are probably right - but I do remember Durk repeatedly mentioning that he'd be supportive of providing properties to easily customize the underlying cleverness and/or disable it completely
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11977
Joined: Tue Mar 25, 2008 8:40 am

Re: Simple Circle Orbit for AI Flightplan

Postby Warty » Mon Aug 31, 2020 4:51 pm

@Stevenj279

For simple circular repeating flight-tracks, I use these (or variations on them) as scenery objects:



Code: Select all
<PropertyList>
  <path>dauphinAir.xml</path>
  <animation>                                     <!-- set speed and radius of circuit -->
    <type>rotate</type>
    <object-name>aircraft</object-name>
    <property>/sim/time/elapsed-sec</property>
    <factor>10.0</factor> <!-- 10 deg per sec  ACW -->
    <offset-deg>90</offset-deg><!-- -90 / reverse for RH ??  -->
    <center><x-m>0</x-m><y-m>-50</y-m><z-m>0</z-m></center><!-- radius  -->
    <axis>      <x>0</x>    <y>0</y>    <z>1</z></axis>
  </animation>
  <animation>                          <!-- make it climb and descend as it goes round -->
    <type>translate</type>
    <object-name>aircraft</object-name>
    <!-- = 40 * (1 + sin(hdg) ) metres, ie: 0 .. 80m -->
     <expression>
       <product>
         <value>40</value>
         <sum>
         <value>1</value>
          <sin>
            <deg2rad>
                <product>
                  <value>10</value><!-- same as rotate factor, eg 10 deg / sec  ACW -->
                  <property>/sim/time/elapsed-sec</property>
                </product>
            </deg2rad>
          </sin>
        </sum>
      </product>
     </expression>   
    <axis>      <x>0</x>    <y>0</y>    <z>1</z></axis>
  </animation>
  <animation>                          <!-- make it pitch up and down as it goes round -->
    <type>rotate</type>
    <object-name>aircraft</object-name>
    <!-- = 20 * sin(hdg)  degrees, ie: +/- 20deg pitch -->
    <expression>
      <product>
         <value>-20</value><!-- nose DOWN @ max alt  -->
            <sin>
              <deg2rad>
                  <product>
                    <value>10</value><!-- same as rotate factor, eg 10 deg / sec  ACW -->
                    <property>/sim/time/elapsed-sec</property>
                  </product>
              </deg2rad>
           </sin>
      </product>
    </expression>   
    <center><x-m>0</x-m><y-m>0</y-m><z-m>0</z-m></center>
    <axis>    <x>0</x>    <y>1</y>    <z>0</z></axis>
  </animation>
</PropertyList>


Maybe you could adapt it for your own purposes.
User avatar
Warty
 
Posts: 267
Joined: Sun Mar 29, 2015 6:53 pm
Location: Spain
Callsign: Warty
Version: 2018.3.5
OS: Mac OSX

Re: Simple Circle Orbit for AI Flightplan

Postby Stevenj279 » Tue Sep 01, 2020 1:37 am

Warty: Many thanks! I definitely will be able to use your example for a few use cases! Very impressive!
Williamsburg, VA
Win 7 Pro 64-bit, Intel Core i7-4700MQ 2.40 GHz
32 Gb Ram, 500 GB SSD, 2 TB SCSI HDD, NVIDIA GeForce GTX 780M
Stevenj279
 
Posts: 47
Joined: Fri Jul 24, 2020 12:26 am

Previous

Return to Flying

Who is online

Users browsing this forum: No registered users and 1 guest