95a46c130d
- 搬运 ST API C 源码到 lib/vl53l0x/, 替换 I2C 层为用户态 i2c-dev - 新增 vl53l0x_platform_user.cpp: WriteMulti/ReadMulti 等全平台接口 - 重写 vl53l0x.cpp: start时unbind内核驱动, 单次测距, 无后台轮询 - 高速模式 20000μs timing budget, 模型缓存零污染(41-43ms) - LiDAR 每5帧一读(~20ms), 隔帧模型推理, fps 25.1→29.6 (+18%) - 同事的LiDAR避障集成: 12个配置参数, 中线变形绕行, 刹车注释 - nice -10 + sched_yield 优先级优化
27 lines
307 B
C++
27 lines
307 B
C++
#ifndef VL53L0X_H
|
|
#define VL53L0X_H
|
|
|
|
#include <cstdint>
|
|
|
|
extern "C" {
|
|
#include "vl53l0x_platform.h"
|
|
}
|
|
|
|
class VL53L0X
|
|
{
|
|
public:
|
|
VL53L0X();
|
|
~VL53L0X();
|
|
|
|
bool init();
|
|
bool readRange(VL53L0X_RangingMeasurementData_t &data);
|
|
bool stop();
|
|
|
|
private:
|
|
int fd;
|
|
bool initialized;
|
|
vl53l0x_dev_t dev;
|
|
};
|
|
|
|
#endif
|