6 轴 IMU(加速度计 + 陀螺仪),带硬件计步器。通过 I²C 连接 LSM6DS3。
仓库:github.com/dekiengine/deki-imu · 最新版本:0.19.0 · 需要引擎 0.19.0 或更高版本 · 依赖:deki-i2c
使用 DekiEditor --packages-add deki-imu <project> 或通过包管理器安装。引擎自身的组件和 C++ API 见 Deki 文档。
在编辑器中显示为 **IMU (Accelerometer + Gyroscope)**。
组件
功能开关
可以从构建中去掉的部分。带有 define 的功能通过该 define 开关,其余的随其组件一起被剥离。
| 功能 | define | 默认值 |
| LSM6DS3 (I²C, 6-axis + hardware pedometer) | DEKI_FEATURE_IMU_LSM6DS3 | 开 |
组件参考
LSM6DS3IMUComponent
通过 I2C 读取 LSM6DS3 运动传感器,包括计步器。
检视器中的名称:LSM6DS3 IMU · 类别:传感器 · 类型:DekiImu::LSM6DS3IMUComponent
| 属性 | 类型 | 默认值 | 约束 | 说明 |
| i2cPort | int32 | 0 | 0 到 3 | 传感器所在的 I2C 总线。必须与设置该端口的 I2C 总线组件一致。 |
| i2cAddress | int32 | 106 | 0 到 127 | 传感器在总线上的地址,由 SDO/SA0 引脚决定:该引脚为低电平时为 0x6A,高电平时为 0x6B。将该引脚接成不同电平,两块这种芯片就能共用一条总线。 |
| enablePedometer | bool | true | | 运行芯片内置的计步器。由硬件计数,无需唤醒 CPU 就能持续累计步数,只会略微增加电流消耗。 |
更新日志
更新日志为英文。
0.19.0
Changed
- minEngine 0.19.0: built against engine 0.19.0, whose component metadata records the package each class is in. A build of this package from before does not load and is rebuilt.
Added
- Japanese, Simplified Chinese and Korean: editor/lang/ja.json, zh.json and ko.json translate the names, tooltips and enum values this package's components show in the Inspector.
0.18.0
Changed
- minEngine 0.18.0. Reflection ABI 21: the package must be rebuilt.
- Names follow the code style (deki-engine/docs/codestyle): types, functions and enum values are PascalCase, constants kPascalCase, members m_PascalCase, locals and parameters camelCase. The code is formatted with clang-format 22.
- The functions the editor finds by name are PascalCase: DekiIMURegisterComponents, DekiIMUGetAutoComponentCount, DekiIMUEnsureRegistered and the rest. Built against engine ABI 21; a build of this package from before does not load and is rebuilt.
Fixed
- LSM6DS3: resetting the step count works. It set a bit in the wrong register, so the count never cleared.
- LSM6DS3: with the pedometer on, the gyroscope's X and Z axes stay on. Turning the pedometer on switched them off on the original LSM6DS3. The pedometer bits now follow the chip: the LSM6DS3 and the LSM6DS3TR-C keep them in different places.
Removed
- The former names from before 0.16.0 (bare class names, and deki-gpio's DekiEsp32::ESP32PinSetup). A scene that old is upgraded with 0.17 first.
更早的版本:CHANGELOG.md
由包的反射数据生成(引擎 0.19.0)。属性名就是场景文件中使用的键。重命名后会保留别名(兼容性)。