Fixing presets: Difference between revisions

Jump to navigation Jump to search
m
Line 19: Line 19:
I anyone wants to work on this, it would be a self-contained function in position-init code, just ask here for any questions. All the pieces certainly exist - the taxiways, parking locations and runways for the airport are all accessible.<ref>{{cite web |url=http://sourceforge.net/p/flightgear/mailman/attachment/F69E014E-F15A-4EAB-B512-36B87CA3B2C5%40mac.com/1/|title= Aircraft positioning on the runway|author=James Turner |date=2013-11-12 10:32:27}}</ref>|James Turner}}
I anyone wants to work on this, it would be a self-contained function in position-init code, just ask here for any questions. All the pieces certainly exist - the taxiways, parking locations and runways for the airport are all accessible.<ref>{{cite web |url=http://sourceforge.net/p/flightgear/mailman/attachment/F69E014E-F15A-4EAB-B512-36B87CA3B2C5%40mac.com/1/|title= Aircraft positioning on the runway|author=James Turner |date=2013-11-12 10:32:27}}</ref>|James Turner}}


== Status (03/2015) ==
{{FGCquote
  |reset and reposition now use the same codepath (something I've been working towards for many months). They do a full control reset, but after that, a full initial state restore. (it would be possible to support a 'nearby' re-position that doesn't touch the tile-manager, AI manager, or so on, and just re-inits the FDM - but that's something for the future, if people want it)
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/26536759/
    |title=<nowiki>Re: [Flightgear-devel] Fwd: in air starts and all preset
control/trim settings broke</nowiki>
    |author=<nowiki>James Turner</nowiki>
    |date=<nowiki>2010-11-03</nowiki>
  }}
}}
{{FGCquote
  |we already saved all the initial state at the end of the main init - but Nasal scripts run before that state is saved - so running presets-commit then confuses things mightily. What I do now, is special case position changes (presets-commit) that happen during startup, and skip the reset path entirely, since it's unnecessary. This gives us:
* Nasal can merrily re-init during startup if it chooses
* control values specified on the command line, -set files or config survive the init process
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/26536759/
    |title=<nowiki>Re: [Flightgear-devel] Fwd: in air starts and all preset
control/trim settings broke</nowiki>
    |author=<nowiki>James Turner</nowiki>
    |date=<nowiki>2010-11-03</nowiki>
  }}
}}
{{FGCquote
  |Reposition and reset from the GUI both work, and will give you the state as specified in the -set & config files, and command line. Since reposition from the GUI *is a* reset (now), some properties may change that previously did not, but I can't imagine a situation where the old behaviour was better - since we already wiped the FDM and control state regardless.
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/26536759/
    |title=<nowiki>Re: [Flightgear-devel] Fwd: in air starts and all preset
control/trim settings broke</nowiki>
    |author=<nowiki>James Turner</nowiki>
    |date=<nowiki>2010-11-03</nowiki>
  }}
}}{{FGCquote
  |Reposition and reset from the GUI both work, and will give you the state as specified in the -set & config files, and command line. Since reposition from the GUI *is a* reset (now), some properties may change that previously did not, but I can't imagine a situation where the old behaviour was better - since we already wiped the FDM and control state regardless.
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/26536759/
    |title=<nowiki>Re: [Flightgear-devel] Fwd: in air starts and all preset
control/trim settings broke</nowiki>
    |author=<nowiki>James Turner</nowiki>
    |date=<nowiki>2010-11-03</nowiki>
  }}
}}
== Background ==
== Background ==
At one point we decided that it would be useful to reset the aircraft position to someplace else while running FlightGear. JSBSim was modified so if it sensed that any of the position properties where changed it would retrim to those values. This was a start, but the problem was that we were using the same set of properties to report fdm position/orientation as we were using to request a change. This turned out to be a little hard to work with, especially if you wanted to change several parameters ... you got reset 1 time for each parameter you changed.
At one point we decided that it would be useful to reset the aircraft position to someplace else while running FlightGear. JSBSim was modified so if it sensed that any of the position properties where changed it would retrim to those values. This was a start, but the problem was that we were using the same set of properties to report fdm position/orientation as we were using to request a change. This turned out to be a little hard to work with, especially if you wanted to change several parameters ... you got reset 1 time for each parameter you changed.

Navigation menu