C路: VL53L0X 用户态I2C直驱 + 高速模式 29.6fps
- 搬运 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 优先级优化
This commit is contained in:
+12
-8
@@ -2,21 +2,25 @@
|
||||
#define VL53L0X_H
|
||||
|
||||
#include <cstdint>
|
||||
#include "vl53l0x_def.h"
|
||||
|
||||
extern "C" {
|
||||
#include "vl53l0x_platform.h"
|
||||
}
|
||||
|
||||
class VL53L0X
|
||||
{
|
||||
public:
|
||||
VL53L0X();
|
||||
~VL53L0X();
|
||||
VL53L0X();
|
||||
~VL53L0X();
|
||||
|
||||
bool init();
|
||||
bool readRange(VL53L0X_RangingMeasurementData_t &data);
|
||||
bool stop();
|
||||
bool isOpen() const { return fd > 0; }
|
||||
bool init();
|
||||
bool readRange(VL53L0X_RangingMeasurementData_t &data);
|
||||
bool stop();
|
||||
|
||||
private:
|
||||
int fd;
|
||||
int fd;
|
||||
bool initialized;
|
||||
vl53l0x_dev_t dev;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user