diff --git a/src/Instrumentation/airspeed_indicator.cxx b/src/Instrumentation/airspeed_indicator.cxx index 27f2f0f17..480d6dab3 100644 --- a/src/Instrumentation/airspeed_indicator.cxx +++ b/src/Instrumentation/airspeed_indicator.cxx @@ -54,13 +54,17 @@ AirspeedIndicator::unbind () # define FPSTOKTS 0.592484 #endif +#ifndef INHGTOPSF +# define INHGTOPSF (2116.217/29.9212) +#endif + void AirspeedIndicator::update (double dt) { if (_serviceable_node->getBoolValue()) { double pt = _total_pressure_node->getDoubleValue(); double p = _static_pressure_node->getDoubleValue(); - double q = pt - p; // dynamic pressure + double q = ( pt - p ) * INHGTOPSF; // dynamic pressure // Now, reverse the equation double v_fps = sqrt((2 * q) / SEA_LEVEL_DENSITY_SLUGFT3); diff --git a/src/Systems/pitot.cxx b/src/Systems/pitot.cxx index 0a58805b5..3cd8f9485 100644 --- a/src/Systems/pitot.cxx +++ b/src/Systems/pitot.cxx @@ -37,16 +37,20 @@ PitotSystem::unbind () { } +#ifndef INHGTOPSF +# define INHGTOPSF (2116.217/29.9212) +#endif + void PitotSystem::update (double dt) { if (_serviceable_node->getBoolValue()) { // The pitot tube sees the forward // velocity in the body axis. - double p = _pressure_node->getDoubleValue(); + double p = _pressure_node->getDoubleValue(); // static double r = _density_node->getDoubleValue(); double v = _velocity_node->getDoubleValue(); - double q = 0.5 * r * v * v; // dynamic pressure + double q = 0.5 * r * v * v / INHGTOPSF; // dynamic _total_pressure_node->setDoubleValue(p + q); } }