On Fri, 2002-02-22 at 11:25, Curtis L. Olson wrote:
> I believe I have found/fixed the initialization order problem.
> Flightgear has a concept of an 'absolute' view position in cartesian
> coordinates where (0,0,0) is the center of the Earth; and a 'relative'
> view position where (0,0,0) is the center of the current tile. (This
> is to work around limitations in 'float' precision in OpenGL.)
>
> To get back a valid terrain intersection, you need both the absolute
> and relative view positions to be set correctly. But, you can't set
> the relative view position until after you know the center point of
> the current tile.
>
> So, in some starting locations by pure chance, we were getting a
> scenery intersection for a wrong location because the relative view
> position hadn't been set correctly yet.
>
> The next time through the loop the relative view position was correct
> and the scenery intersection point was the also correct.
>
> The problem was that the FDM initialization was handed a wrong
> starting altitude which could understandably confuse the FDM.
>
> I have commited fixes to CVS for this problem.
>
> --------> Tony <---------
>
> Even after these fixes though, JSBSim flips upside down and flags a
> 'mishap'[1] at CL77.
>
> There is something about this airport that still confuses the JSBSim
> initialization code. Perhaps it is the steep slope of the runway?
>
> [1] note the careful use of wording to avoid confusing with an
> application or computer crash. :-)
OK, this is what I found at CL77.
>From the console log, the terrain altitude JSBSim gets at init time
is 1924.47 ft:
Starting and initializing JSBsim
Start common FDM init
...initializing position...
FGJSBsim::set_Longitude: -2.13148
FGJSBsim::set_Latitude: 0.646962
cur alt (ft) = 0
FGJSBsim::set_Altitude: 1924.47
lat (deg) = 37.0682
Terrain altitude: 1924.47
^^^^^^^^^^^^^^^^^^^^^^^^^^^
...initializing ground elevation to 1924.47ft...
...initializing sea-level radius...
lat = 37.0682 alt = 1924.47
...initializing velocities...
FGJSBsim::set_V_calibrated_kts: 0
...initializing Euler angles...
FGJSBsim::set_Euler_Angles: 0, 0.0074002, 5.51524
End common FDM init
However, putting an output statement just before the ground trim ( in
the first call to FGInterface::update() ) is run shows that it has
changed:
Loading tile /home/tony/FlightGear/Scenery/w130n30/w123n37/942018
token = OBJECT_BASE name = 942018.btg
Ready to trim, terrain altitude is: 1928.41
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Ground Trim
Initial Theta: 0.9126
Trim successful
JSBSim State
Trim complete
I put in code to update JSBSim's terrain altitude right before
the trim and it does improve matters, but not 100% as the final
terrain altitude doesn't always seem to be available at that time.
As noted yesterday, setting --altitude works around the problem. What
seems to be more interesting about that is that JSBSim gets initialized
with the final terrain altitude very reliably. Might be a clue to
what's really wrong.
I didn't look at LOWI, though I suspect the problem there is similar.
>
> Regards,
>
> Curt.
> --
> Curtis Olson IVLab / HumanFIRST Program FlightGear Project
> Twin Cities [EMAIL PROTECTED] [EMAIL PROTECTED]
> Minnesota http://www.menet.umn.edu/~curt http://www.flightgear.org
>
>
> Cameron Moore writes:
> > * [EMAIL PROTECTED] (Curt Olson) [2002.02.22 12:26]:
> > > Jim Wilson writes:
> > > > Hope they disconnected the usb Flamethrower first :-) I'm getting the same
> > > > thing with CL77. Some screwy looking airstrip. There still seems to be some
> > > > problems with altitude between fg and jsbsim. A workaround is to add a
> > > > --alititude=(runway elevation) to the command line.
> > > >
> > > > This perhaps is a naive question, but why aren't we kicking in the FDM after
> > > > the plane is on the runway during initialization?
> > >
> > > We are actually doing this. We don't initialize the FDM until the
> > > scenery subsystem is reporting a valid ground elevation. However, for
> > > some starting locations it appears that the initial reported elevation
> > > is incorrect the first frame and then updated to the correct elevation
> > > the second frame.
> >
> > This may be totally unrelated, but ... The FPE issue I posted about the
> > other day is triggered when the tile manager is initialized. Could
> > it be that tile manager is getting a bogus starting point due to this
> > FPE bug, and that bogus value is making it's way to the FDM's?
> > --
> > Cameron Moore
> > / If a person with multiple personalities threatens \
> > \ suicide, is that considered a hostage situation? /
> >
> > _______________________________________________
> > Flightgear-devel mailing list
> > [EMAIL PROTECTED]
> > http://mail.flightgear.org/mailman/listinfo/flightgear-devel
>
>
> _______________________________________________
> Flightgear-devel mailing list
> [EMAIL PROTECTED]
> http://mail.flightgear.org/mailman/listinfo/flightgear-devel
--
Tony Peden
[EMAIL PROTECTED]
We all know Linux is great ... it does infinite loops in 5 seconds.
-- attributed to Linus Torvalds
_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel