From c0c732f55291f08ffb25360dd5f98cb63184b620 Mon Sep 17 00:00:00 2001 From: Federico Mandelli <federicomandelli@skywarder.eu> Date: Tue, 10 Oct 2023 18:27:15 +0200 Subject: [PATCH] [Pitot] Now checks that inputs are greater then 0 --- src/shared/sensors/analog/Pitot/Pitot.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shared/sensors/analog/Pitot/Pitot.h b/src/shared/sensors/analog/Pitot/Pitot.h index 4a445dcfa..bbcacee52 100644 --- a/src/shared/sensors/analog/Pitot/Pitot.h +++ b/src/shared/sensors/analog/Pitot/Pitot.h @@ -60,7 +60,8 @@ public: float totalPressure = getTotalPressure(); float staticPressure = getStaticPressure(); PitotData pitotSpeed; - if (totalPressure > staticPressure) + if (totalPressure > 0 && staticPressure > 0 && + totalPressure > staticPressure) { float gamma = 1.4f; -- GitLab