1
0
Fork 0

Jim Wilson:

Here's a patch to fix the asi problem (it affects most aircraft panels).
[ Avoids a sqrt( x < 0 ) ]
This commit is contained in:
curt 2003-02-16 20:47:40 +00:00
parent d4d53763d9
commit 317e48ba4f

View file

@ -59,7 +59,9 @@ AirspeedIndicator::update (double dt)
double p = _static_pressure_node->getDoubleValue();
double q = ( pt - p ) * INHGTOPSF; // dynamic pressure
// Now, reverse the equation
// Now, reverse the equation (normalize dynamic pressure to
// avoid "nan" results from sqrt)
if ( q < 0 ) { q = 0.0; }
double v_fps = sqrt((2 * q) / SEA_LEVEL_DENSITY_SLUGFT3);
// Publish the indicated airspeed