From 878c8bfcce19d4d3e8c5f4cbe1ec44da41b0dd34 Mon Sep 17 00:00:00 2001 From: RomanBapst Date: Tue, 10 Sep 2024 17:50:03 +0300 Subject: [PATCH] SIH: fix airspeed for tailsitter Signed-off-by: RomanBapst --- src/modules/simulation/simulator_sih/sih.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/simulation/simulator_sih/sih.cpp b/src/modules/simulation/simulator_sih/sih.cpp index 399a4ecc93..2ca4987338 100644 --- a/src/modules/simulation/simulator_sih/sih.cpp +++ b/src/modules/simulation/simulator_sih/sih.cpp @@ -450,7 +450,8 @@ void Sih::send_airspeed(const hrt_abstime &time_now_us) // TODO: send differential pressure instead? airspeed_s airspeed{}; airspeed.timestamp_sample = time_now_us; - airspeed.true_airspeed_m_s = fmaxf(0.1f, _v_B(0) + generate_wgn() * 0.2f); + // airspeed sensor is mounted along the negative Z axis since the vehicle is a tailsitter + airspeed.true_airspeed_m_s = fmaxf(0.1f, -_v_B(2) + generate_wgn() * 0.2f); airspeed.indicated_airspeed_m_s = airspeed.true_airspeed_m_s * sqrtf(_wing_l.get_rho() / RHO); airspeed.air_temperature_celsius = NAN; airspeed.confidence = 0.7f;