This driver is intended to be used for Benewake TFmini and TF-Luna UART single-point short distance sensors based on the TOF (Time of Flight) principle.
These lidars mainly used for stable, accurate and high-frame-rate range detection.
The supported list of sensors are:
| Sensor | Image | All supported protocols | Distance |
|---|---|---|---|
| TFmini-S / TFmini Plus | ![]() |
UART, I2C, I/O | 0.1 - 12 meters |
| TF-Luna | ![]() |
UART, I2C, I/O | 0.2 - 8 meters |
The driver for the sensors is the same, except head byte.
| Reference | TF-Luna datasheet TFmini datasheet |
| Requred periphery | UART |
| Unit tests | test_tf_mini.cpp |
Installation:
- Include the header file
tf_mini.hand source filetf_mini.cin your C/C++ code. - Ensure that the required dependencies are installed, such as the STM32 HAL library or any other libraries specific to your STM32 development environment.
Usage:
- Call
tfMiniInit(Benewake_tf_lidar_t lidar)in the beginning of your program - Obtain data from UART/serial.
- Call
tfParseRangeto parse the raw data.
- Sensor connection with Ardupilot based autopilots: https://ardupilot.org/copter/docs/common-benewake-tf02-lidar.html
- Sensor connection with PX4 based autopilots: https://docs.px4.io/main/en/sensor/tfmini.html

