On 2/1/07, tangyong wrote:

Hi,everybody.I use these command lines to record a flight,then I replay
it.

 Recording: fgfs --generic=file,out,20,flight.out,playback
 Playback:  fgfs --generic=file,in,20,flight.out,playback --fdm=external
but when I replay the flight record,I find the aircraft jittering,the
flight is not smooth.why?And in the protocol "playback.xml",it does record
the aircraft's veolocities and positions etc.Since the position is
only record at intervals ,does the FG use the velocity value to
display aircraft in the meantime, between records.  If FG does this,the
flight and aircraft shuld not jitter.Can anybody tell me the reson?


I've never tried to play back data recorded with the "generic" protocol so I
don't know all the issues, but Stuart makes some good points.  Timing is
very critical.  Even though you specify an output rate, FlightGear isn't
doing this in a separate independent thread (not that a thread would
directly help the situation anyway.)  FlightGear can only output data once
at the end of drawing each frame of graphics.

So as Stuart points out, if you are running at a somewhat inconsistent frame
rate (let's say varying between 35-45 fps) and you can only output at the
end of each frame, then the actual data intervals in your data file will
jitter around substantially.  Include sim time in your output and look at
your "dt" between each record.

I'm certain that the "generic" protocol makes no attempt to interpolate the
incoming data in time.  It just just plucks out the next record every 20 hz
(or as close to that as it can get) and updates the view.

So hear again if your playback frame rates are varying and FlightGear waits
until at least 50ms has elapsed before fetching the next data packet, then
any jitter at the recording stage is only going to be magnified at the
playback stage.

When dealing with external animation sources or playback, you *really* need
to worry about locking FlightGear into a consistent frame rate (either with
sync to vblank ... which is always a good idea ... and/or with the built in
frame rate throttler code.)

Note that all these mechanism can limit frame rates, but nothing can make
FlightGear go faster (short of simplifying the graphics load or improving
your hardware.)

Take care to ensure you are running with exact, consistent frame rates, and
your life will become a lot happier!

Curt.
--
Curtis Olson - University of Minnesota - FlightGear Project
http://baron.flightgear.org/~curt/  http://www.humanfirst.umn.edu/
http://www.flightgear.org
Unique text: 2f585eeea02e2c79d7b1d8c4963bae2d
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to