Robustify Ulanding Radar (#24333)

* [ulanding_radar] Fix comms error perf counter usage

* [ulanding_radar] Workaround for lost messages by lowering sampling rate

The current implementation of the Aerotenna uLanding radar driver assumes that
the UART frames are received in full. If the driver polls with 10ms this is not
always the case and the driver will fail to parse the frame leading to
significant packet loss. This workaround polls at 12ms which ensures that at
least one entire frame is received.
This commit is contained in:
Niklas Hauser
2025-02-28 21:14:32 +01:00
committed by GitHub
parent 0a9a1a1552
commit 336d055923
2 changed files with 7 additions and 2 deletions
@@ -125,10 +125,15 @@ int AerotennaULanding::collect()
index--;
}
} else {
return -EAGAIN;
}
if (!checksum_passed) {
return -EAGAIN;
perf_count(_comms_errors);
perf_end(_sample_perf);
return -EBADMSG;
}
_px4_rangefinder.update(timestamp_sample, distance_m);
@@ -56,7 +56,7 @@
using namespace time_literals;
#define ULANDING_MEASURE_INTERVAL 10_ms
#define ULANDING_MEASURE_INTERVAL 12_ms
#define ULANDING_MAX_DISTANCE 50.0f
#define ULANDING_MIN_DISTANCE 0.315f
#define ULANDING_VERSION 1