From cf1a1ec88bbf543134946543abe5a90a5d76b380 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 19 Feb 2025 13:40:55 +1100 Subject: [PATCH] AP_Rangefinder: request measurement for timer routine to collect the timer routing attempts to read a reading off the bus straihgt-up, but after initialisation the sensor will not be attempting to provide one, so this will always fail. Request a sample as the last thing we do in the init routine --- libraries/AP_RangeFinder/AP_RangeFinder_TeraRangerI2C.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/AP_RangeFinder/AP_RangeFinder_TeraRangerI2C.cpp b/libraries/AP_RangeFinder/AP_RangeFinder_TeraRangerI2C.cpp index fe034246d8..c04128649d 100644 --- a/libraries/AP_RangeFinder/AP_RangeFinder_TeraRangerI2C.cpp +++ b/libraries/AP_RangeFinder/AP_RangeFinder_TeraRangerI2C.cpp @@ -97,6 +97,9 @@ bool AP_RangeFinder_TeraRangerI2C::init(void) return false; } + // ask for a new reading for the timer to collect: + measure(); + dev->get_semaphore()->give(); dev->set_retries(1);