From 726d3008a44bdd7f99e18f96554db051828b8920 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 3 May 2023 18:42:16 +1000 Subject: [PATCH] SITL: mount rngefinder 5cm above the ground --- libraries/SITL/SIM_Aircraft.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/SITL/SIM_Aircraft.cpp b/libraries/SITL/SIM_Aircraft.cpp index 7c8082b460f719..328d80e438696d 100644 --- a/libraries/SITL/SIM_Aircraft.cpp +++ b/libraries/SITL/SIM_Aircraft.cpp @@ -555,6 +555,9 @@ float Aircraft::rangefinder_range() const // Add some noise on reading altitude += sitl->sonar_noise * rand_float(); + // this rangefinder is mounted on the simulated frame, 5cm off the ground: + altitude += 0.05; + return altitude; }