Fixing presets: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 1: Line 1:
At one point we decided that it would be useful to reset the aircraft position to someplace else while running FlightGear. Tony modified JSBSim 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.


So somewhere along the line we came up with a /presets property tree. The idea is that you can fill the tree with all the preset pameters you want to set. Then call for either an on-ground reset or an in-air reset.
So somewhere along the line we came up with a /presets property tree. The idea is that you can fill the tree with all the preset pameters you want to set. Then call for either an on-ground reset or an in-air reset.


I think the approach itself is very sound, however, it's the implimentation spread across a couple different FDM's and a lot of various code changes that has become a bit complicated.
I think the approach itself is very sound, however, it's the implimentation spread across a couple different FDM's and a lot of various code changes that has become a bit complicated.
There's a /sim/presets area in the property manager which is where all the FDM initial conditions can be batched up.  Things like:
*  airport-id      (i.e. KSFO)
*  runway          (i.e. 1R)
*  offset-distance (i.e. 7 miles out)
*  altitude        (i.e. 2000')
*  glideslope      (i.e. on a 3 degree glide slope)
*  airspeed        (i.e. 90 kts)
You can set any or all of these and when you are satisfied, choose the Presets->Commit menu option (or its corresponding fgcommand).


Please note that there is a lot of complexity in this task and a lot of interdependencies with other pieces of the program. We might be able to hide or move or rearrange the complexity, but it's always going to be a little tricky.
Please note that there is a lot of complexity in this task and a lot of interdependencies with other pieces of the program. We might be able to hide or move or rearrange the complexity, but it's always going to be a little tricky.
Line 25: Line 37:
   
   
I'm sure that people can think of a better classification.  From this point on, then, our initialization code can simply look at these to decide whether to initialize based on the airport, etc.<ref>{{cite web |url=http://www.mail-archive.com/flightgear-devel@flightgear.org/msg17214.html |title= Beyond presets|author=David Megginson |date=Fri, 19 Sep 2003 13:07:52 -0700}}</ref>|David Megginson}}
I'm sure that people can think of a better classification.  From this point on, then, our initialization code can simply look at these to decide whether to initialize based on the airport, etc.<ref>{{cite web |url=http://www.mail-archive.com/flightgear-devel@flightgear.org/msg17214.html |title= Beyond presets|author=David Megginson |date=Fri, 19 Sep 2003 13:07:52 -0700}}</ref>|David Megginson}}
{{cquote|
There's also more to the problem.  If we're restoring a saved flight then everything's fine, since all of the FDM state is already valid. If, on the other hand, we're starting in the air, then we need a general trimming routine like the one Tony wrote for JSBSim and LaRCsim to avoid violent oscillations at startup.<ref>{{cite web |url=http://www.mail-archive.com/flightgear-devel@flightgear.org/msg09856.html |title= Presets menu|author=David Megginson |date=Mon, 18 Nov 2002 14:44:41 -0800}}</ref>|David Megginson}}


<references/>
<references/>

Navigation menu