From af4b8da1ec5aa96e1117275e742392a6daf31339 Mon Sep 17 00:00:00 2001 From: Jacob Moore Date: Tue, 31 Dec 2024 08:23:45 -0700 Subject: [PATCH] fixed the calculation for air density --- src/sensors.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sensors.cpp b/src/sensors.cpp index 6dad39dd..4bba53a0 100644 --- a/src/sensors.cpp +++ b/src/sensors.cpp @@ -175,7 +175,7 @@ got_flags Sensors::run() rf_.board_.baro_read(&data_.baro_pressure, &data_.baro_temperature); correct_baro(); - rho_ = (0.0289644 * data_.baro_pressure) / (8.31432 * data_.baro_temperature); + rho_ = 1.225 * pow(data_.baro_pressure / 101325.0, 0.809736894596450); } }