Hi PX4 Community,
I have developed an enhanced UART driver for the Benewake TF02-Pro LiDAR rangefinder to fix a critical synchronization and update-rate issue when fusing altitude data in EKF2.
The Problem:
The current default PX4 UART driver for this rangefinder publishes distance data at a fixed rate of 1\text{ Hz}, despite the TF02-Pro outputting at a much higher physical frequency. Because EKF2 does not wait for this slower altitude measurement during its update loop, the altitude estimate frequently out-synced, resulting in high Z-reset counters and poor fusion stability during GPS-denied or VIO-based flights. It also struggled with accuracy below its minimum range threshold.
The Solution:
I’ve rewritten the driver to allow the data acquisition/publish rate to be fully configurable instead of locked at 1\text{ Hz}. In our flight testing, we configured it to feed EKF2 at 100\text{ Hz}. To mitigate high-frequency sensor noise, the driver collects the raw high-frequency samples arriving within the interval, averages them, and then publishes the smoothed value at the configured rate.
Results:
Eliminated the synchronization mismatch and fixed the high Z-reset counter issues in EKF2.Greatly improved altitude hold stability, especially critical for GPS-denied state estimation.
I am preparing a Pull Request on GitHub to merge this into the main branch. I would love to get feedback from the driver and hardware maintainers on the best way to clean this up for upstream integration.
Thanks!