修复LK电机id计算错误,构建平衡底盘框架,增加通用通信模块,增加平衡底盘条件编译兼容,删除lqr

This commit is contained in:
NeoZng
2023-02-16 15:46:04 +08:00
parent b9a7d87dfd
commit a2a83f9fbf
35 changed files with 554 additions and 242 deletions

View File

@@ -2,19 +2,18 @@
**注意,此模块待测试**
## 示例
```c
BMI088_Init_Config_s imu_config = {
.spi_acc_config={
.GPIO_cs=GPIOC,
.GPIO_cs=GPIO_PIN_4,
.GPIOx=GPIOC,
.GPIOx=GPIO_PIN_4,
.spi_handle=&hspi1,
},
.spi_gyro_config={
.GPIO_cs=GPIOC,
.GPIO_cs=GPIO_PIN_4,
.GPIOx=GPIOC,
.GPIOx=GPIO_PIN_4,
.spi_handle=&hspi1,
},
.acc_int_config={
@@ -63,9 +62,11 @@ BMI088Instance* imu=BMI088Register(&imu_config);
`__HAL_GPIO_EXTI_GENERATE_SWIT()` `HAL_EXTI_GENERATE_SWI()` 可以触发软件中断
of course,两者的数据更新实际上可以异步进行,这里为了方便起见当两者数据都准备好以后再行融合
## 数据读写规则(so called 16-bit protocol)
加速度计读取read:
1. bit 0 :1 bit 1-7: reg address
2. dummy read,加速度计此时返回的数据无效
3. 真正的数据从第三个字节开始.
@@ -76,6 +77,7 @@ byte2: 没用
byte3: 读取到的数据
write写入:
1. bit 0: 0 bit1-7: reg address
2. 要写入寄存器的数据(注意没有dummy byte)
@@ -84,6 +86,7 @@ write写入:
**注意,陀螺仪和加速度计的读取不同**
陀螺仪gyro读取read:
1. bit 0 :1 bit1-7: reg address
2. 读回的数据
@@ -92,7 +95,6 @@ byte1: 1(读)+7位寄存器地址
byte2: 读取到的数据
write写入:
1. bit0 : 0 bit1-7 : reg address
2. 写入的数据