diff --git a/README.md b/README.md
index 80f3d8d..76b05d0 100644
--- a/README.md
+++ b/README.md
@@ -47,7 +47,7 @@
设计要点:
-- **两板源码高度同构**。`Application/`、`Bsp/`、`modules/` 绝大多数文件在两棵树下是同一份拷贝,板级差异用 `ROBOT_TYPE_*` 宏在文件内条件编译(而不是拆成两套文件)。**因此改一处通常要同步改另一处**,详见 [§11](#11-已知陷阱与注意事项)。
+- **两板源码高度同构**。`Lib/`、`Bsp/` 以及 `App/` 的大部分文件在两棵树下是同一份拷贝(`Lib/` 两板完全相同),板级差异用 `ROBOT_TYPE_*` 宏在文件内条件编译(而不是拆成两套文件)。**因此改一处通常要同步改另一处**,详见 [§11](#11-已知陷阱与注意事项)。
- **姿态由 QuaternionEKF 统一负责**。两板各有一颗板载 BMI088,跑同一套 Wang Hongxi 的 QuaternionEKF 四元数 EKF(陀螺积分预测 + 加速度重力观测 + 卡方检验),不再使用 legacy 的 Mahony 互补滤波,也不再依赖预编译的 `AHRS.lib`。
- **跟随采用"双 INS 世界系"方案**。云台把自己解算出的世界系 yaw 通过 CAN 发给底盘,底盘用自身 INS 的 yaw 相减得到相对偏差。两板 INS 的上电零点任意但差值天然正确,因而绕开了皮带虚位与基准锁定时序的坑。
@@ -97,13 +97,17 @@ Simba-OmniInfantry/
├── doc/
│ └── 已知问题与排障.md 踩坑记录与排障手册(强烈建议先读)
├── 云台/ ┐
-│ ├── Application/ │ 应用层
-│ │ ├── Task/Inc/ │ 任务头文件(app_tasks.h 汇总声明)
-│ │ ├── Task/Src/ │ 各任务实现
+│ ├── App/ │ ★ 本板业务,按功能一个文件夹(任务和逻辑放在一起)
│ │ ├── robot_param.h │ ★ 整车唯一调参入口(含台架调试开关)
-│ │ └── robot_typedef.h │ 应用层公共类型
-│ ├── Bsp/ │ 板级支持包(与具体外设寄存器打交道)
-│ │ ├── Inc/ Src/ │ bsp_can(过滤器+按ID分发回调)、bsp_usart(DMA收发)
+│ │ ├── robot_typedef.h │ 应用层公共类型
+│ │ ├── system/ │ 启动初始化、监控看门狗、姿态任务、USB 调试输出
+│ │ ├── cmd/ │ 控制指令汇总 + DR16 遥控器解析
+│ │ ├── comm/ │ 板间通讯
+│ │ ├── referee/ │ 裁判系统(底盘另有自定义 UI)
+│ │ ├── gimbal/ shoot/ vision/│ 云台、发射、视觉(仅云台板)
+│ │ └── chassis/ │ 底盘(仅底盘板)
+│ ├── Lib/ │ ★ 与业务无关的通用模块(两板内容相同,见下)
+│ ├── Bsp/ │ 板级支持包:bsp_can(过滤器+按ID分发回调)、bsp_usart(DMA收发)
│ ├── Core/ │ CubeMX 生成的初始化与中断
│ │ ├── Src/main.c │ 外设初始化顺序
│ │ ├── Src/freertos.c │ ★ 任务创建与优先级/栈大小
@@ -112,26 +116,38 @@ Simba-OmniInfantry/
│ ├── Drivers/ │ ST HAL + CMSIS(勿手改)
│ ├── Middlewares/ │ FreeRTOS / USB Device Library / CMSIS-DSP
│ ├── USB_DEVICE/ │ USB CDC 设备栈(usbd_cdc_if.c 为应用接口)
-│ ├── modules/ │ ★ 按角色分层的功能模块(见下)
│ └── MDK-ARM/ │ Keil 工程与启动文件
└── 底盘/ ┘ 结构同上
```
-### `modules/` 分层(2026-09 重排)
+### `App/` / `Lib/` / `Bsp/` 分层(2026-11 目录整理)
+
+一句话规则:**想改哪个功能,就去 `App/` 下对应的文件夹;和业务无关的通用工具在 `Lib/`;直接操作外设的在 `Bsp/`。** Keil 工程左侧的分组名和这些文件夹一一对应。新旧路径对照见 [doc/目录整理说明.md](./doc/目录整理说明.md)。
+
+> 注意:`USB_DEVICE/App/` 是 CubeMX 生成的 USB 虚拟串口代码,和根目录下的业务 `App/` 不是一回事。
```
-modules/
-├── algorithm/ 通用算法 pid, filter
-├── imu/ 姿态与惯导封装 attitude(对外姿态 API)、ins(QEKF 封装)
-│ └── qekf/ 第三方移植内核 QuaternionEKF、kalman_filter(移植自 Wang Hongxi INS 例程)
-├── sensor/ 板载传感器驱动 bmi088(SPI+DMA)、ist8310(I2C 磁力计)
-├── comms/ 通讯 dr16(遥控器)、referee(裁判/图传)、c_comm(板间)、vision(视觉,仅云台板)
-├── motor/ 电机抽象 dji_motor(大疆电机统一接口)
-├── control/ 整车控制逻辑 gimbal + shoot(云台板) / chassis(底盘板)
-└── dev/ 板级指示与发声 led、buzzer
+App/ 本板业务(两板有些文件不同)
+├── robot_param.h robot_typedef.h
+├── system/ can_task(启动初始化)、monitor_task(心跳/灯语/看门狗)、imu_task(1 kHz 姿态)、debug_task(USB 遥测)、app_tasks.h
+├── cmd/ robot_cmd_task(控制指令汇总)、dr16(遥控器帧解析)
+├── comm/ c_comm_task、c_comm(板间通讯)
+├── referee/ referee_task、referee(裁判/图传)、referee_ui(仅底盘)
+├── gimbal/ gimbal_task、gimbal ┐
+├── shoot/ shoot_task、shoot ├ 仅云台板
+├── vision/ vision ┘
+└── chassis/ chassis_task、chassis、hlj_pc(功率控制)、supercap(超级电容) 仅底盘板
+Lib/ 通用模块(两板完全相同)
+├── algorithm/ pid、filter
+├── motor/ dji_motor(大疆电机统一接口)
+├── imu/ attitude(对外姿态 API)、ins(QEKF 封装)
+│ └── qekf/ 第三方移植内核:QuaternionEKF、kalman_filter(移植自 Wang Hongxi INS 例程)
+├── sensor/ bmi088(SPI+DMA)、ist8310(I2C 磁力计)
+└── dev/ led、buzzer
+Bsp/ bsp_can、bsp_usart
```
-> `imu/qekf/` 里的两个文件是原样移植的第三方代码,**尽量不改**;要改先读 `imu/attitude.c` 与 `imu/ins.c` 的文件头注释(QEKF 内部 Pitch/Roll 命名与航空惯例互换)。
+> `Lib/imu/qekf/` 里的两个文件是原样移植的第三方代码,**尽量不改**;要改先读 `Lib/imu/attitude.c` 与 `Lib/imu/ins.c` 的文件头注释(QEKF 内部 Pitch/Roll 命名与航空惯例互换)。
---
@@ -190,7 +206,7 @@ FreeRTOS 节拍 1 kHz。任务来自 `Core/Src/freertos.c`:
### 6.3 板间通讯协议(CToC)
-帧 ID 与 legacy 一致,定义见 `modules/comms/c_comm.h`:
+帧 ID 与 legacy 一致,定义见 `App/comm/c_comm.h`:
| 帧 | 方向 | 内容 |
| --- | --- | --- |
@@ -205,16 +221,16 @@ FreeRTOS 节拍 1 kHz。任务来自 `Core/Src/freertos.c`:
```
BMI088(SPI1 + DMA,EXTI 数据就绪)
- └─> modules/sensor/bmi088.c 解析出 bmi088_accel[] / bmi088_gyro[]
- └─> modules/imu/ins.c z 零偏补偿 + QEKF 更新(1 kHz)
- └─> modules/imu/attitude.c 输出 att_deg_yaw / att_deg_pitch / att_deg_roll
+ └─> Lib/sensor/bmi088.c 解析出 bmi088_accel[] / bmi088_gyro[]
+ └─> Lib/imu/ins.c z 零偏补偿 + QEKF 更新(1 kHz)
+ └─> Lib/imu/attitude.c 输出 att_deg_yaw / att_deg_pitch / att_deg_roll
├─> control/gimbal.c Yaw/Pitch 环反馈
└─> comms/c_comm.c 0x1A9 帧发给底盘
```
### 6.5 视觉上位机(自瞄)
-协议模块 `modules/comms/vision.c`(仅云台板),`CAN_Task` 里 `vision_init()` 完成 RX/TX DMA 与 NVIC 初始化(USART1 中断入口在 `stm32f4xx_it.c` 的 USER CODE 区补齐)。
+协议模块 `App/vision/vision.c`(仅云台板),`CAN_Task` 里 `vision_init()` 完成 RX/TX DMA 与 NVIC 初始化(USART1 中断入口在 `stm32f4xx_it.c` 的 USER CODE 区补齐)。
**帧格式(ASCII,空格分隔)**:
@@ -233,22 +249,24 @@ BMI088(SPI1 + DMA,EXTI 数据就绪)
| 模块 | 路径 | 职责 |
| --- | --- | --- |
-| `pid` | `algorithm/` | 位置式/增量式 PID,双环共用 |
-| `filter` | `algorithm/` | 通用滤波器(低通等) |
-| `attitude` | `imu/` | 对外的姿态 API:初始化、1 kHz 更新、`att_deg_*`、磁力计轮询、IMU 加热控制 |
-| `ins` | `imu/` | QEKF 封装 + z 轴零偏标定 + 机体系/导航系变换 + 运动加速度 |
-| `QuaternionEKF` / `kalman_filter` | `imu/qekf/` | 第三方移植:四元数 EKF 与通用卡尔曼框架(**勿轻易改**) |
-| `bmi088` | `sensor/` | 六轴 IMU 驱动(SPI1 模式 3 @5.25 MHz,INT 数据就绪触发 DMA,含数据路自恢复) |
-| `ist8310` | `sensor/` | 三轴磁力计(硬件 I2C3,200 Hz 轮询) |
-| `dr16` | `comms/` | DR16 遥控器帧解析 |
-| `referee` / `referee_ui` | `comms/` | 裁判系统 / 图传链路解析;底盘板含自定义 UI 组包发送(`referee_ui.c`) |
-| `vision` | `comms/` | 视觉上位机 ASCII 协议解析与姿态反馈(仅云台板) |
-| `c_comm` | `comms/` | 板间通讯收发与故障位综合 |
-| `dji_motor` | `motor/` | 大疆电机(CAN 反馈解析 + 电流/电压下发)统一抽象 |
-| `gimbal` | `control/` | 云台 Yaw/Pitch 双环 + yaw 装配符号自检 |
-| `shoot` | `control/` | 摩擦轮 + 拨弹 |
-| `chassis` | `control/` | 麦轮解算 + 轮速环 + 跟随 + 功率限制 |
-| `led` / `buzzer` | `dev/` | 三色 LED(TIM5 PWM)与无源蜂鸣器(TIM4_CH3/PD14) |
+| `pid` | `Lib/algorithm/` | 位置式/增量式 PID,双环共用 |
+| `filter` | `Lib/algorithm/` | 通用滤波器(低通等) |
+| `attitude` | `Lib/imu/` | 对外的姿态 API:初始化、1 kHz 更新、`att_deg_*`、磁力计轮询、IMU 加热控制 |
+| `ins` | `Lib/imu/` | QEKF 封装 + z 轴零偏标定 + 机体系/导航系变换 + 运动加速度 |
+| `QuaternionEKF` / `kalman_filter` | `Lib/imu/qekf/` | 第三方移植:四元数 EKF 与通用卡尔曼框架(**勿轻易改**) |
+| `bmi088` | `Lib/sensor/` | 六轴 IMU 驱动(SPI1 模式 3 @5.25 MHz,INT 数据就绪触发 DMA,含数据路自恢复) |
+| `ist8310` | `Lib/sensor/` | 三轴磁力计(硬件 I2C3,200 Hz 轮询) |
+| `dr16` | `App/cmd/` | DR16 遥控器帧解析 |
+| `referee` / `referee_ui` | `App/referee/` | 裁判系统 / 图传链路解析;底盘板含自定义 UI 组包发送(`referee_ui.c`) |
+| `vision` | `App/vision/` | 视觉上位机 ASCII 协议解析与姿态反馈(仅云台板) |
+| `c_comm` | `App/comm/` | 板间通讯收发与故障位综合 |
+| `dji_motor` | `Lib/motor/` | 大疆电机(CAN 反馈解析 + 电流/电压下发)统一抽象 |
+| `gimbal` | `App/gimbal/` | 云台 Yaw/Pitch 双环 + yaw 装配符号自检 |
+| `shoot` | `App/shoot/` | 摩擦轮 + 拨弹 |
+| `chassis` | `App/chassis/` | 麦轮解算 + 轮速环 + 跟随 + 功率限制 |
+| `hlj_pc` | `App/chassis/` | 底盘功率控制:电机功率模型 + 按裁判功率上限/缓冲能量/超电状态算功率预算(仅底盘板) |
+| `supercap` | `App/chassis/` | 超级电容通讯:CAN1 发 `0x001`、收 `0x100`,100 Hz(仅底盘板) |
+| `led` / `buzzer` | `Lib/dev/` | 三色 LED(TIM5 PWM)与无源蜂鸣器(TIM4_CH3/PD14) |
| `bsp_can` | `Bsp/` | CAN 过滤器、按 (总线, 标准 ID) 分发回调、发送封装 |
| `bsp_usart` | `Bsp/` | 三路串口的循环 DMA + 空闲中断整帧接收,以及 TX DMA |
@@ -256,7 +274,7 @@ BMI088(SPI1 + DMA,EXTI 数据就绪)
## 8. 调试:USB CDC 遥测
-`Application/Task/Src/debug_task.c` 每 100 ms 输出一行(单位:角度 ° / 加速度 m/s² / 角速度 rad/s):
+`App/system/debug_task.c` 每 100 ms 输出一行(单位:角度 ° / 加速度 m/s² / 角速度 rad/s):
```
yaw=-0.03 pitch=-25.58 roll=-8.00 cvg=1 rdy=1 imu=1 an=9.80 gn=0.017
@@ -273,7 +291,7 @@ gx=0.0012 gy=-0.0031 gz=0.0165 zo=0.0009 ck=1 ca=803 cg=1002 se=0 st=1
| `pitch` | 绕 y 轴角(`= QEKF_INS.Roll`) |
| `roll` | 绕 x 轴角(`= QEKF_INS.Pitch`,云台 Pitch 环反馈用它) |
-> QEKF 内部 Pitch/Roll 命名与航空惯例**互换**,映射关系与原因见 `modules/imu/attitude.c` 文件头。
+> QEKF 内部 Pitch/Roll 命名与航空惯例**互换**,映射关系与原因见 `Lib/imu/attitude.c` 文件头。
### 健康位与诊断位
@@ -302,7 +320,7 @@ gx=0.0012 gy=-0.0031 gz=0.0165 zo=0.0009 ck=1 ca=803 cg=1002 se=0 st=1
## 9. 调参与开关
-**所有可调参数集中在 `Application/robot_param.h`**(整车唯一调参入口),分区如下:
+**所有可调参数集中在 `App/robot_param.h`**(整车唯一调参入口),分区如下:
| 分区 | 内容 |
| --- | --- |
@@ -369,7 +387,7 @@ gx=0.0012 gy=-0.0031 gz=0.0165 zo=0.0009 ck=1 ca=803 cg=1002 se=0 st=1
### 11.2 libc 堆必须 ≥ 8 KB(QEKF 的矩阵内存靠 `malloc`)
-`modules/imu/qekf/kalman_filter.h` 的分配宏:
+`Lib/imu/qekf/kalman_filter.h` 的分配宏:
```c
#ifdef _CMSIS_OS_H
@@ -419,7 +437,7 @@ BMI088 的 DRDY 是**电平型**信号:某次失败或被挡掉的读取没把
### 11.8 其他
- `arm_mat_*` 失败是**静默**的:尺寸不符或 `pData = NULL` 时只返回错误码、不修改输出。调用方不查返回码,滤波器就会"看起来在跑但状态不更新"。
-- `modules/imu/qekf/` 是第三方移植代码,改动前先读原例程与 `attitude.c` 的文件头约定。
+- `Lib/imu/qekf/` 是第三方移植代码,改动前先读原例程与 `attitude.c` 的文件头约定。
- `Middlewares/ST/ARM/DSP/Lib/*.lib` 是**源码依赖而非构建产物**,已纳入版本管理,不要把 `*.lib` 加进 `.gitignore`。
- 无源蜂鸣器 `buzzer_on(BUZZER_P)` 即静音,旋律表里用它作断音。
@@ -429,9 +447,9 @@ BMI088 的 DRDY 是**电平型**信号:某次失败或被挡掉的读取没把
- 仓库根为 git 仓库,内含两个子工程;`.gitignore` 排除 Keil 构建产物、`*.uvguix.*`、`DebugConfig/`、`.workbuddy/`。
- **`core.autocrlf=false`**:固件源码是 LF,不要让 git 在检出时改成 CRLF。
-- 注意换行符风格并不统一:`Core/Src/*.c` 与 `.ioc` 是 CRLF,`modules/**` 等是 LF。批量脚本改文件时要按文件自动适配。
+- 注意换行符风格并不统一:`Core/Src/*.c` 与 `.ioc` 是 CRLF,`App/**`、`Lib/**`、`Bsp/**` 等是 LF。批量脚本改文件时要按文件自动适配。
- 两板同构:改动请**同步改两棵树**,并确认差异只出现在应当不同的文件上(`gimbal*`/`shoot*` 只在云台,`chassis*` 只在底盘);公共参数段由 `module_test/tools/check_param_common.py` 校验一致性。
-- **注释与代码规范**:自研业务代码(`Bsp/`、`modules/`、`Application/`)统一采用 Legacy 注释风格——函数头使用 `/* *函数简介: *参数说明: *返回类型: *备注: */` 块注释,宏/结构体成员/关键语句使用紧凑行尾 `//说明`;公开接口与回调均需做空指针、边界及 HAL 返回值检查。
+- **注释与代码规范**:自研业务代码(`App/`、`Lib/`、`Bsp/`)统一采用 Legacy 注释风格——函数头使用 `/* *函数简介: *参数说明: *返回类型: *备注: */` 块注释,宏/结构体成员/关键语句使用紧凑行尾 `//说明`;公开接口与回调均需做空指针、边界及 HAL 返回值检查。
- **BSP 防御性二次初始化**:`bsp_can.c`(补开 `CAN2_RX0_IRQn`)、`bsp_usart.c`(重配 `USART3` 9 位字长)、`bmi088.c`(重配 `SPI1` 模式 3/16 分频)、`vision.c`(补开 `USART1_IRQn`) 会在运行时覆写 CubeMX 默认外设配置,属有意防御设计,无需为此修改 `.ioc`。
---
diff --git a/doc/目录整理说明.md b/doc/目录整理说明.md
new file mode 100644
index 0000000..6b45832
--- /dev/null
+++ b/doc/目录整理说明.md
@@ -0,0 +1,130 @@
+# 目录整理说明(哨兵分支,2026-11)
+
+> 一句话:**只搬了文件位置、改了 Keil 工程分组和头文件路径、更新了文档里的旧路径。程序一行没变。**
+> 这是**哨兵分支 `sentry-chassis`** 上的整理,基于战队 `main` 的提交 `9de485e`(代码风格更新以及加入超电的对接)。步兵的 `main` 不受影响,仍是原来的目录。云台、底盘两块板同样处理,保持同构。
+
+---
+
+## 1. 为什么整理
+
+以前找一个功能的文件要翻好几个地方。比如"底盘":任务在 `Application/Task/Src/chassis_task.c`,逻辑在 `modules/control/chassis.c`,功率控制在 `modules/control/hlj_pc.c`,超级电容又在 `modules/dev/supercap.c`。另外:
+
+- `Application/Task` 分 `Inc/` 和 `Src/`,`modules/` 却是 `.c` `.h` 放一起,两种风格并存;
+- Keil 工程左侧的分组(`Application/Task`、`Modules`、`BSP`)和硬盘上的文件夹对不上。
+
+## 2. 新结构和规则
+
+**想改哪个功能,就去 `App/` 下对应的文件夹;和业务无关的通用工具在 `Lib/`;直接操作外设的在 `Bsp/`。**
+Keil 工程左侧的分组名和文件夹名一一对应(`App/system`、`Lib/imu`、`Bsp` ……)。
+
+```
+App/ 本板业务(两板有些文件不同)
+├── robot_param.h robot_typedef.h
+├── system/ can_task(启动初始化)、monitor_task(心跳/灯语/看门狗)、imu_task、debug_task、app_tasks.h
+├── cmd/ robot_cmd_task(控制指令汇总)、dr16(遥控器帧解析)
+├── comm/ c_comm_task、c_comm(板间通讯)
+├── referee/ referee_task、referee、referee_ui(仅底盘)
+├── gimbal/ gimbal_task、gimbal ┐
+├── shoot/ shoot_task、shoot ├ 仅云台板
+├── vision/ vision ┘
+└── chassis/ chassis_task、chassis、hlj_pc(功率控制)、supercap(超级电容) 仅底盘板
+Lib/ 通用模块(两板完全相同)
+├── algorithm/ pid、filter
+├── motor/ dji_motor
+├── imu/ attitude、ins、qekf/(第三方内核,勿轻易改)
+├── sensor/ bmi088、ist8310
+└── dev/ led、buzzer
+Bsp/ bsp_can、bsp_usart(不再分 Inc/Src)
+```
+
+几个归类说明:
+
+- **注意别和 `USB_DEVICE/App/` 搞混**:那个是 CubeMX 生成的 USB 虚拟串口代码(`usb_device.c`、`usbd_cdc_if.c` 等),整理前就在,不能改名。我们的业务代码是板子根目录下的 `App/`。
+- `dr16`(遥控器帧解析)放在 `App/cmd/`:它是"控制指令"的输入来源,和 `robot_cmd_task` 一起看最顺。
+- `imu_task` 放在 `App/system/`:它是任务;姿态算法本身(`attitude`、`ins`、`qekf`)在 `Lib/imu/`。
+- `hlj_pc`、`supercap` 放在 `App/chassis/`:只在底盘板上,只为底盘服务。
+- `Lib/` 只放两板**逐字节相同**的文件(按 `9de485e` 比对过)。两板有差异的都留在 `App/`。
+
+## 3. 新旧路径对照
+
+两块板相同的部分(路径相对 `云台/` 或 `底盘/`):
+
+| 旧路径 | 新路径 |
+| --- | --- |
+| `Application/robot_param.h`、`robot_typedef.h` | `App/` |
+| `Application/Task/Inc/app_tasks.h` | `App/system/` |
+| `Application/Task/Src/can_task.c`、`monitor_task.c`、`imu_task.c`、`debug_task.c` + `Inc/debug_task.h` | `App/system/` |
+| `Application/Task/Src/robot_cmd_task.c` + `Inc/robot_cmd_task.h` | `App/cmd/` |
+| `modules/comms/dr16.c/.h` | `App/cmd/` |
+| `Application/Task/Src/c_comm_task.c`、`modules/comms/c_comm.c/.h` | `App/comm/` |
+| `Application/Task/Src/referee_task.c` + `Inc/referee_task.h`、`modules/comms/referee.c/.h` | `App/referee/` |
+| `modules/algorithm/pid.c/.h`、`filter.c/.h` | `Lib/algorithm/` |
+| `modules/motor/dji_motor.c/.h` | `Lib/motor/` |
+| `modules/imu/attitude.c/.h`、`ins.c/.h` | `Lib/imu/` |
+| `modules/imu/qekf/QuaternionEKF.c/.h`、`kalman_filter.c/.h` | `Lib/imu/qekf/` |
+| `modules/sensor/bmi088.c/.h`、`ist8310.c/.h` | `Lib/sensor/` |
+| `modules/dev/led.c/.h`、`buzzer.c/.h` | `Lib/dev/` |
+| `Bsp/Src/bsp_can.c`、`bsp_usart.c`、`Bsp/Inc/bsp_can.h`、`bsp_usart.h` | `Bsp/` |
+
+只有云台板:
+
+| 旧路径 | 新路径 |
+| --- | --- |
+| `Application/Task/Src/gimbal_task.c`、`modules/control/gimbal.c/.h` | `App/gimbal/` |
+| `Application/Task/Src/shoot_task.c`、`modules/control/shoot.c/.h` | `App/shoot/` |
+| `modules/comms/vision.c/.h` | `App/vision/` |
+
+只有底盘板:
+
+| 旧路径 | 新路径 |
+| --- | --- |
+| `Application/Task/Src/chassis_task.c`、`modules/control/chassis.c/.h` | `App/chassis/` |
+| `modules/control/hlj_pc.c/.h`、`modules/dev/supercap.c/.h` | `App/chassis/` |
+| `modules/comms/referee_ui.c/.h` | `App/referee/` |
+
+**文件名一个都没改**,所以 `#include "xxx.h"` 全部不用动。
+
+## 4. 改了哪些东西
+
+| 改动 | 说明 |
+| --- | --- |
+| 搬文件 | 全部用 `git mv`(107 个文件),git 识别为重命名,`git log --follow 文件` 能看到搬家前的历史 |
+| `.uvprojx` 分组 | 原来的 `Application/Task`、`Modules`、`BSP` 三个分组,换成和新文件夹同名的分组。登记的文件集合和原来**完全一样** |
+| `.uvprojx` 头文件路径 | 去掉旧目录,在原位置插入新目录;CubeMX 和第三方的目录原样保留、顺序不变 |
+| `.uvoptx` | 分组同步更新,`GroupNumber`/`FileNumber` 重新连续编号(README §11.1 的要求) |
+| 文档 | 根 `README.md` 代码地图、分层说明、模块清单(补上 `hlj_pc`、`supercap`)、各处路径和注释规范里的目录名;`云台/README.md`、`底盘/README.md` 的路径表 |
+
+**CubeMX 生成的部分一律没动**:`Core/`、`Drivers/`、`Middlewares/`、`USB_DEVICE/`、Keil 里 `Application/MDK-ARM`、`Application/User/...` 这些分组名,以及 `freertos.c` 里的任务名(`CAN_Task`、`LED_Task` 等,改名会影响 CubeMX 重新生成)。`module_test/` 工程也没动。
+
+## 5. 怎么证明"程序没变"
+
+整理前后用**同一个编译器**把两块板各编译一遍,对比:
+
+| 板子 | 整理前 Program Size | 整理后 Program Size |
+| --- | --- | --- |
+| 底盘 | Code=111184 RO-data=1956 RW-data=432 ZI-data=62720 | **完全相同** |
+| 云台 | Code=109876 RO-data=1960 RW-data=420 ZI-data=62764 | **完全相同** |
+
+再对比链接生成的 `.map` 符号表(每个函数、变量的名字、类型、大小、来自哪个 `.o`,忽略地址):
+
+- 底盘 1155 个符号、云台 1156 个符号,整理前后**逐条一致**;
+- 唯一的差别是链接器记录的"源文件路径"条目(调试信息,大小为 0),这正是搬家本身,数量也一致(两板都是 278 条)。
+
+> 说明:验证用的是作者本机的 ARMCLANG V6.7(战队用 V6.24)。验证的是"整理前后"用同一个编译器比较,所以结论成立;但这里的具体数字不能直接拿去和 V6.24 编出来的比。提交的工程文件仍是战队原来的 V6.24 设置。
+
+## 6. 以后要跟进步兵的更新时
+
+哨兵分支和步兵 `main` 目录不同,把 `main` 的新提交合进来时:
+
+- 步兵**修改**的老路径文件,git 一般能识别"文件已搬家",自动把改动带到新位置;偶尔要手动处理冲突。
+- 步兵**新增**的文件会落在老路径(`Application/`、`modules/`),需要手动 `git mv` 到新目录,并在 Keil 里登记到对应分组。
+- 合并后照样做一次编译,确认 0 错误。
+
+## 7. 还没做的(第二阶段候选)
+
+1. **文件开头的整体说明**:`9de485e` 删掉了 58 个文件开头的"这个文件管什么、数据从哪来"说明块。哨兵分支会在下一个提交里对照新代码逐个恢复(单独提交,只改注释)。
+2. **`doc/已知问题与排障.md` 已在 `957c535` 里被删除**,但 README 仍然链接它(链接失效)。
+3. 名字和实际职责不符的,比如 `CAN_Task`(实际是总初始化)、`LED_Task`(实际是监控看门狗)、底盘轮子变量名。
+4. 把 `#if ROBOT_TYPE_*` 分成两半的文件(`robot_cmd_task.c`、`c_comm.c` 等)拆成两块板各一个文件。
+5. 两板完全相同的 `Lib/` 只保留一份,两个工程共同引用。
+6. 删除没人用的代码。
diff --git a/云台/modules/comms/dr16.c b/云台/App/cmd/dr16.c
similarity index 100%
rename from 云台/modules/comms/dr16.c
rename to 云台/App/cmd/dr16.c
diff --git a/云台/modules/comms/dr16.h b/云台/App/cmd/dr16.h
similarity index 100%
rename from 云台/modules/comms/dr16.h
rename to 云台/App/cmd/dr16.h
diff --git a/云台/Application/Task/Src/robot_cmd_task.c b/云台/App/cmd/robot_cmd_task.c
similarity index 100%
rename from 云台/Application/Task/Src/robot_cmd_task.c
rename to 云台/App/cmd/robot_cmd_task.c
diff --git a/云台/Application/Task/Inc/robot_cmd_task.h b/云台/App/cmd/robot_cmd_task.h
similarity index 100%
rename from 云台/Application/Task/Inc/robot_cmd_task.h
rename to 云台/App/cmd/robot_cmd_task.h
diff --git a/云台/modules/comms/c_comm.c b/云台/App/comm/c_comm.c
similarity index 100%
rename from 云台/modules/comms/c_comm.c
rename to 云台/App/comm/c_comm.c
diff --git a/云台/modules/comms/c_comm.h b/云台/App/comm/c_comm.h
similarity index 100%
rename from 云台/modules/comms/c_comm.h
rename to 云台/App/comm/c_comm.h
diff --git a/云台/Application/Task/Src/c_comm_task.c b/云台/App/comm/c_comm_task.c
similarity index 100%
rename from 云台/Application/Task/Src/c_comm_task.c
rename to 云台/App/comm/c_comm_task.c
diff --git a/云台/modules/control/gimbal.c b/云台/App/gimbal/gimbal.c
similarity index 100%
rename from 云台/modules/control/gimbal.c
rename to 云台/App/gimbal/gimbal.c
diff --git a/云台/modules/control/gimbal.h b/云台/App/gimbal/gimbal.h
similarity index 100%
rename from 云台/modules/control/gimbal.h
rename to 云台/App/gimbal/gimbal.h
diff --git a/云台/Application/Task/Src/gimbal_task.c b/云台/App/gimbal/gimbal_task.c
similarity index 100%
rename from 云台/Application/Task/Src/gimbal_task.c
rename to 云台/App/gimbal/gimbal_task.c
diff --git a/云台/modules/comms/referee.c b/云台/App/referee/referee.c
similarity index 100%
rename from 云台/modules/comms/referee.c
rename to 云台/App/referee/referee.c
diff --git a/云台/modules/comms/referee.h b/云台/App/referee/referee.h
similarity index 100%
rename from 云台/modules/comms/referee.h
rename to 云台/App/referee/referee.h
diff --git a/云台/Application/Task/Src/referee_task.c b/云台/App/referee/referee_task.c
similarity index 100%
rename from 云台/Application/Task/Src/referee_task.c
rename to 云台/App/referee/referee_task.c
diff --git a/云台/Application/Task/Inc/referee_task.h b/云台/App/referee/referee_task.h
similarity index 100%
rename from 云台/Application/Task/Inc/referee_task.h
rename to 云台/App/referee/referee_task.h
diff --git a/云台/Application/robot_param.h b/云台/App/robot_param.h
similarity index 100%
rename from 云台/Application/robot_param.h
rename to 云台/App/robot_param.h
diff --git a/云台/Application/robot_typedef.h b/云台/App/robot_typedef.h
similarity index 100%
rename from 云台/Application/robot_typedef.h
rename to 云台/App/robot_typedef.h
diff --git a/云台/modules/control/shoot.c b/云台/App/shoot/shoot.c
similarity index 100%
rename from 云台/modules/control/shoot.c
rename to 云台/App/shoot/shoot.c
diff --git a/云台/modules/control/shoot.h b/云台/App/shoot/shoot.h
similarity index 100%
rename from 云台/modules/control/shoot.h
rename to 云台/App/shoot/shoot.h
diff --git a/云台/Application/Task/Src/shoot_task.c b/云台/App/shoot/shoot_task.c
similarity index 100%
rename from 云台/Application/Task/Src/shoot_task.c
rename to 云台/App/shoot/shoot_task.c
diff --git a/云台/Application/Task/Inc/app_tasks.h b/云台/App/system/app_tasks.h
similarity index 100%
rename from 云台/Application/Task/Inc/app_tasks.h
rename to 云台/App/system/app_tasks.h
diff --git a/云台/Application/Task/Src/can_task.c b/云台/App/system/can_task.c
similarity index 100%
rename from 云台/Application/Task/Src/can_task.c
rename to 云台/App/system/can_task.c
diff --git a/云台/Application/Task/Src/debug_task.c b/云台/App/system/debug_task.c
similarity index 100%
rename from 云台/Application/Task/Src/debug_task.c
rename to 云台/App/system/debug_task.c
diff --git a/云台/Application/Task/Inc/debug_task.h b/云台/App/system/debug_task.h
similarity index 100%
rename from 云台/Application/Task/Inc/debug_task.h
rename to 云台/App/system/debug_task.h
diff --git a/云台/Application/Task/Src/imu_task.c b/云台/App/system/imu_task.c
similarity index 100%
rename from 云台/Application/Task/Src/imu_task.c
rename to 云台/App/system/imu_task.c
diff --git a/云台/Application/Task/Src/monitor_task.c b/云台/App/system/monitor_task.c
similarity index 100%
rename from 云台/Application/Task/Src/monitor_task.c
rename to 云台/App/system/monitor_task.c
diff --git a/云台/modules/comms/vision.c b/云台/App/vision/vision.c
similarity index 100%
rename from 云台/modules/comms/vision.c
rename to 云台/App/vision/vision.c
diff --git a/云台/modules/comms/vision.h b/云台/App/vision/vision.h
similarity index 100%
rename from 云台/modules/comms/vision.h
rename to 云台/App/vision/vision.h
diff --git a/云台/Bsp/Src/bsp_can.c b/云台/Bsp/bsp_can.c
similarity index 100%
rename from 云台/Bsp/Src/bsp_can.c
rename to 云台/Bsp/bsp_can.c
diff --git a/云台/Bsp/Inc/bsp_can.h b/云台/Bsp/bsp_can.h
similarity index 100%
rename from 云台/Bsp/Inc/bsp_can.h
rename to 云台/Bsp/bsp_can.h
diff --git a/云台/Bsp/Src/bsp_usart.c b/云台/Bsp/bsp_usart.c
similarity index 100%
rename from 云台/Bsp/Src/bsp_usart.c
rename to 云台/Bsp/bsp_usart.c
diff --git a/云台/Bsp/Inc/bsp_usart.h b/云台/Bsp/bsp_usart.h
similarity index 100%
rename from 云台/Bsp/Inc/bsp_usart.h
rename to 云台/Bsp/bsp_usart.h
diff --git a/云台/modules/algorithm/filter.c b/云台/Lib/algorithm/filter.c
similarity index 100%
rename from 云台/modules/algorithm/filter.c
rename to 云台/Lib/algorithm/filter.c
diff --git a/云台/modules/algorithm/filter.h b/云台/Lib/algorithm/filter.h
similarity index 100%
rename from 云台/modules/algorithm/filter.h
rename to 云台/Lib/algorithm/filter.h
diff --git a/云台/modules/algorithm/pid.c b/云台/Lib/algorithm/pid.c
similarity index 100%
rename from 云台/modules/algorithm/pid.c
rename to 云台/Lib/algorithm/pid.c
diff --git a/云台/modules/algorithm/pid.h b/云台/Lib/algorithm/pid.h
similarity index 100%
rename from 云台/modules/algorithm/pid.h
rename to 云台/Lib/algorithm/pid.h
diff --git a/云台/modules/dev/buzzer.c b/云台/Lib/dev/buzzer.c
similarity index 100%
rename from 云台/modules/dev/buzzer.c
rename to 云台/Lib/dev/buzzer.c
diff --git a/云台/modules/dev/buzzer.h b/云台/Lib/dev/buzzer.h
similarity index 100%
rename from 云台/modules/dev/buzzer.h
rename to 云台/Lib/dev/buzzer.h
diff --git a/云台/modules/dev/led.c b/云台/Lib/dev/led.c
similarity index 100%
rename from 云台/modules/dev/led.c
rename to 云台/Lib/dev/led.c
diff --git a/云台/modules/dev/led.h b/云台/Lib/dev/led.h
similarity index 100%
rename from 云台/modules/dev/led.h
rename to 云台/Lib/dev/led.h
diff --git a/云台/modules/imu/attitude.c b/云台/Lib/imu/attitude.c
similarity index 100%
rename from 云台/modules/imu/attitude.c
rename to 云台/Lib/imu/attitude.c
diff --git a/云台/modules/imu/attitude.h b/云台/Lib/imu/attitude.h
similarity index 100%
rename from 云台/modules/imu/attitude.h
rename to 云台/Lib/imu/attitude.h
diff --git a/云台/modules/imu/ins.c b/云台/Lib/imu/ins.c
similarity index 100%
rename from 云台/modules/imu/ins.c
rename to 云台/Lib/imu/ins.c
diff --git a/云台/modules/imu/ins.h b/云台/Lib/imu/ins.h
similarity index 100%
rename from 云台/modules/imu/ins.h
rename to 云台/Lib/imu/ins.h
diff --git a/云台/modules/imu/qekf/QuaternionEKF.c b/云台/Lib/imu/qekf/QuaternionEKF.c
similarity index 100%
rename from 云台/modules/imu/qekf/QuaternionEKF.c
rename to 云台/Lib/imu/qekf/QuaternionEKF.c
diff --git a/云台/modules/imu/qekf/QuaternionEKF.h b/云台/Lib/imu/qekf/QuaternionEKF.h
similarity index 100%
rename from 云台/modules/imu/qekf/QuaternionEKF.h
rename to 云台/Lib/imu/qekf/QuaternionEKF.h
diff --git a/云台/modules/imu/qekf/kalman_filter.c b/云台/Lib/imu/qekf/kalman_filter.c
similarity index 100%
rename from 云台/modules/imu/qekf/kalman_filter.c
rename to 云台/Lib/imu/qekf/kalman_filter.c
diff --git a/云台/modules/imu/qekf/kalman_filter.h b/云台/Lib/imu/qekf/kalman_filter.h
similarity index 100%
rename from 云台/modules/imu/qekf/kalman_filter.h
rename to 云台/Lib/imu/qekf/kalman_filter.h
diff --git a/云台/modules/motor/dji_motor.c b/云台/Lib/motor/dji_motor.c
similarity index 100%
rename from 云台/modules/motor/dji_motor.c
rename to 云台/Lib/motor/dji_motor.c
diff --git a/云台/modules/motor/dji_motor.h b/云台/Lib/motor/dji_motor.h
similarity index 100%
rename from 云台/modules/motor/dji_motor.h
rename to 云台/Lib/motor/dji_motor.h
diff --git a/云台/modules/sensor/bmi088.c b/云台/Lib/sensor/bmi088.c
similarity index 100%
rename from 云台/modules/sensor/bmi088.c
rename to 云台/Lib/sensor/bmi088.c
diff --git a/云台/modules/sensor/bmi088.h b/云台/Lib/sensor/bmi088.h
similarity index 100%
rename from 云台/modules/sensor/bmi088.h
rename to 云台/Lib/sensor/bmi088.h
diff --git a/云台/modules/sensor/ist8310.c b/云台/Lib/sensor/ist8310.c
similarity index 100%
rename from 云台/modules/sensor/ist8310.c
rename to 云台/Lib/sensor/ist8310.c
diff --git a/云台/modules/sensor/ist8310.h b/云台/Lib/sensor/ist8310.h
similarity index 100%
rename from 云台/modules/sensor/ist8310.h
rename to 云台/Lib/sensor/ist8310.h
diff --git a/云台/MDK-ARM/Simba-ELCT-FrameWork.uvoptx b/云台/MDK-ARM/Simba-ELCT-FrameWork.uvoptx
index ae0eb35..6893a5e 100644
--- a/云台/MDK-ARM/Simba-ELCT-FrameWork.uvoptx
+++ b/云台/MDK-ARM/Simba-ELCT-FrameWork.uvoptx
@@ -1044,7 +1044,7 @@
- Application/Task
+ App/system
0
0
0
@@ -1056,7 +1056,7 @@
0
0
0
- ..\Application\Task\Src\can_task.c
+ ..\App\system\can_task.c
can_task.c
0
0
@@ -1068,7 +1068,7 @@
0
0
0
- ..\Application\Task\Inc\app_tasks.h
+ ..\App\system\app_tasks.h
app_tasks.h
0
0
@@ -1080,7 +1080,7 @@
0
0
0
- ..\Application\Task\Src\monitor_task.c
+ ..\App\system\monitor_task.c
monitor_task.c
0
0
@@ -1092,327 +1092,139 @@
0
0
0
- ..\Application\Task\Src\robot_cmd_task.c
- robot_cmd_task.c
- 0
- 0
-
-
- 9
- 69
- 5
- 0
- 0
- 0
- ..\Application\Task\Inc\robot_cmd_task.h
- robot_cmd_task.h
- 0
- 0
-
-
- 9
- 70
- 1
- 0
- 0
- 0
- ..\Application\Task\Src\c_comm_task.c
- c_comm_task.c
- 0
- 0
-
-
- 9
- 71
- 1
- 0
- 0
- 0
- ..\Application\Task\Src\referee_task.c
- referee_task.c
- 0
- 0
-
-
- 9
- 72
- 5
- 0
- 0
- 0
- ..\Application\Task\Inc\referee_task.h
- referee_task.h
- 0
- 0
-
-
- 9
- 73
- 1
- 0
- 0
- 0
- ..\Application\Task\Src\debug_task.c
- debug_task.c
- 0
- 0
-
-
- 9
- 74
- 5
- 0
- 0
- 0
- ..\Application\Task\Inc\debug_task.h
- debug_task.h
- 0
- 0
-
-
- 9
- 75
- 1
- 0
- 0
- 0
- ..\Application\Task\Src\imu_task.c
+ ..\App\system\imu_task.c
imu_task.c
0
0
9
- 76
+ 69
1
0
0
0
- ..\Application\Task\Src\gimbal_task.c
- gimbal_task.c
+ ..\App\system\debug_task.c
+ debug_task.c
0
0
9
- 77
- 1
+ 70
+ 5
0
0
0
- ..\Application\Task\Src\shoot_task.c
- shoot_task.c
+ ..\App\system\debug_task.h
+ debug_task.h
0
0
- Modules
+ App/cmd
0
0
0
0
10
- 78
+ 71
1
0
0
0
- ..\modules\algorithm\pid.c
- pid.c
+ ..\App\cmd\robot_cmd_task.c
+ robot_cmd_task.c
0
0
10
- 79
- 1
+ 72
+ 5
0
0
0
- ..\modules\algorithm\filter.c
- filter.c
+ ..\App\cmd\robot_cmd_task.h
+ robot_cmd_task.h
0
0
10
- 80
+ 73
1
0
0
0
- ..\modules\motor\dji_motor.c
- dji_motor.c
- 0
- 0
-
-
- 10
- 81
- 1
- 0
- 0
- 0
- ..\modules\comms\dr16.c
+ ..\App\cmd\dr16.c
dr16.c
0
0
+
+
+
+ App/gimbal
+ 0
+ 0
+ 0
+ 0
- 10
- 82
+ 11
+ 74
1
0
0
0
- ..\modules\comms\referee.c
- referee.c
+ ..\App\gimbal\gimbal_task.c
+ gimbal_task.c
0
0
- 10
- 83
+ 11
+ 75
1
0
0
0
- ..\modules\comms\vision.c
- vision.c
- 0
- 0
-
-
- 10
- 84
- 1
- 0
- 0
- 0
- ..\modules\dev\led.c
- led.c
- 0
- 0
-
-
- 10
- 85
- 1
- 0
- 0
- 0
- ..\modules\dev\buzzer.c
- buzzer.c
- 0
- 0
-
-
- 10
- 86
- 1
- 0
- 0
- 0
- ..\modules\comms\c_comm.c
- c_comm.c
- 0
- 0
-
-
- 10
- 87
- 1
- 0
- 0
- 0
- ..\modules\sensor\bmi088.c
- bmi088.c
- 0
- 0
-
-
- 10
- 88
- 1
- 0
- 0
- 0
- ..\modules\sensor\ist8310.c
- ist8310.c
- 0
- 0
-
-
- 10
- 89
- 1
- 0
- 0
- 0
- ..\modules\imu\attitude.c
- attitude.c
- 0
- 0
-
-
- 10
- 90
- 1
- 0
- 0
- 0
- ..\modules\imu\qekf\kalman_filter.c
- kalman_filter.c
- 0
- 0
-
-
- 10
- 91
- 1
- 0
- 0
- 0
- ..\modules\imu\qekf\QuaternionEKF.c
- QuaternionEKF.c
- 0
- 0
-
-
- 10
- 92
- 1
- 0
- 0
- 0
- ..\modules\imu\ins.c
- ins.c
- 0
- 0
-
-
- 10
- 93
- 1
- 0
- 0
- 0
- ..\modules\control\gimbal.c
+ ..\App\gimbal\gimbal.c
gimbal.c
0
0
+
+
+
+ App/shoot
+ 0
+ 0
+ 0
+ 0
- 10
- 94
+ 12
+ 76
1
0
0
0
- ..\modules\control\shoot.c
+ ..\App\shoot\shoot_task.c
+ shoot_task.c
+ 0
+ 0
+
+
+ 12
+ 77
+ 1
+ 0
+ 0
+ 0
+ ..\App\shoot\shoot.c
shoot.c
0
0
@@ -1420,55 +1232,323 @@
- BSP
+ App/vision
0
0
0
0
- 11
+ 13
+ 78
+ 1
+ 0
+ 0
+ 0
+ ..\App\vision\vision.c
+ vision.c
+ 0
+ 0
+
+
+
+
+ App/comm
+ 0
+ 0
+ 0
+ 0
+
+ 14
+ 79
+ 1
+ 0
+ 0
+ 0
+ ..\App\comm\c_comm_task.c
+ c_comm_task.c
+ 0
+ 0
+
+
+ 14
+ 80
+ 1
+ 0
+ 0
+ 0
+ ..\App\comm\c_comm.c
+ c_comm.c
+ 0
+ 0
+
+
+
+
+ App/referee
+ 0
+ 0
+ 0
+ 0
+
+ 15
+ 81
+ 1
+ 0
+ 0
+ 0
+ ..\App\referee\referee_task.c
+ referee_task.c
+ 0
+ 0
+
+
+ 15
+ 82
+ 5
+ 0
+ 0
+ 0
+ ..\App\referee\referee_task.h
+ referee_task.h
+ 0
+ 0
+
+
+ 15
+ 83
+ 1
+ 0
+ 0
+ 0
+ ..\App\referee\referee.c
+ referee.c
+ 0
+ 0
+
+
+
+
+ Lib/algorithm
+ 0
+ 0
+ 0
+ 0
+
+ 16
+ 84
+ 1
+ 0
+ 0
+ 0
+ ..\Lib\algorithm\pid.c
+ pid.c
+ 0
+ 0
+
+
+ 16
+ 85
+ 1
+ 0
+ 0
+ 0
+ ..\Lib\algorithm\filter.c
+ filter.c
+ 0
+ 0
+
+
+
+
+ Lib/motor
+ 0
+ 0
+ 0
+ 0
+
+ 17
+ 86
+ 1
+ 0
+ 0
+ 0
+ ..\Lib\motor\dji_motor.c
+ dji_motor.c
+ 0
+ 0
+
+
+
+
+ Lib/imu
+ 0
+ 0
+ 0
+ 0
+
+ 18
+ 87
+ 1
+ 0
+ 0
+ 0
+ ..\Lib\imu\attitude.c
+ attitude.c
+ 0
+ 0
+
+
+ 18
+ 88
+ 1
+ 0
+ 0
+ 0
+ ..\Lib\imu\ins.c
+ ins.c
+ 0
+ 0
+
+
+ 18
+ 89
+ 1
+ 0
+ 0
+ 0
+ ..\Lib\imu\qekf\kalman_filter.c
+ kalman_filter.c
+ 0
+ 0
+
+
+ 18
+ 90
+ 1
+ 0
+ 0
+ 0
+ ..\Lib\imu\qekf\QuaternionEKF.c
+ QuaternionEKF.c
+ 0
+ 0
+
+
+
+
+ Lib/sensor
+ 0
+ 0
+ 0
+ 0
+
+ 19
+ 91
+ 1
+ 0
+ 0
+ 0
+ ..\Lib\sensor\bmi088.c
+ bmi088.c
+ 0
+ 0
+
+
+ 19
+ 92
+ 1
+ 0
+ 0
+ 0
+ ..\Lib\sensor\ist8310.c
+ ist8310.c
+ 0
+ 0
+
+
+
+
+ Lib/dev
+ 0
+ 0
+ 0
+ 0
+
+ 20
+ 93
+ 1
+ 0
+ 0
+ 0
+ ..\Lib\dev\led.c
+ led.c
+ 0
+ 0
+
+
+ 20
+ 94
+ 1
+ 0
+ 0
+ 0
+ ..\Lib\dev\buzzer.c
+ buzzer.c
+ 0
+ 0
+
+
+
+
+ Bsp
+ 0
+ 0
+ 0
+ 0
+
+ 21
95
1
0
0
0
- ..\Bsp\Src\bsp_can.c
+ ..\Bsp\bsp_can.c
bsp_can.c
0
0
- 11
+ 21
96
1
0
0
0
- ..\Bsp\Src\bsp_usart.c
+ ..\Bsp\bsp_usart.c
bsp_usart.c
0
0
- 11
+ 21
97
5
0
0
0
- ..\Bsp\Inc\bsp_can.h
+ ..\Bsp\bsp_can.h
bsp_can.h
0
0
- 11
+ 21
98
5
0
0
0
- ..\Bsp\Inc\bsp_usart.h
+ ..\Bsp\bsp_usart.h
bsp_usart.h
0
0
@@ -1482,7 +1562,7 @@
0
0
- 12
+ 22
99
4
0
diff --git a/云台/MDK-ARM/Simba-ELCT-FrameWork.uvprojx b/云台/MDK-ARM/Simba-ELCT-FrameWork.uvprojx
index 525a337..7053f2f 100644
--- a/云台/MDK-ARM/Simba-ELCT-FrameWork.uvprojx
+++ b/云台/MDK-ARM/Simba-ELCT-FrameWork.uvprojx
@@ -341,7 +341,7 @@
USE_HAL_DRIVER,STM32F407xx,ARM_MATH_CM4,ROBOT_TYPE_GIMBAL
- ../Core/Inc;../Drivers/STM32F4xx_HAL_Driver/Inc;../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy;../Middlewares/Third_Party/FreeRTOS/Source/include;../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS;../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F;../Drivers/CMSIS/Device/ST/STM32F4xx/Include;../Drivers/CMSIS/Include;../USB_DEVICE/App;../USB_DEVICE/Target;../Middlewares/ST/STM32_USB_Device_Library/Core/Inc;../Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc;../Application/Task/;../Bsp/Inc;../Application;../Application/Task/Inc;../Middlewares/ST/ARM/DSP/Inc;../modules/algorithm;../modules/imu;../modules/imu/qekf;../modules/sensor;../modules/comms;../modules/motor;../modules/control;../modules/dev
+ ../Core/Inc;../Drivers/STM32F4xx_HAL_Driver/Inc;../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy;../Middlewares/Third_Party/FreeRTOS/Source/include;../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS;../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F;../Drivers/CMSIS/Device/ST/STM32F4xx/Include;../Drivers/CMSIS/Include;../USB_DEVICE/App;../USB_DEVICE/Target;../Middlewares/ST/STM32_USB_Device_Library/Core/Inc;../Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc;../App;../App/system;../App/cmd;../App/gimbal;../App/shoot;../App/vision;../App/comm;../App/referee;../Lib/algorithm;../Lib/motor;../Lib/imu;../Lib/imu/qekf;../Lib/sensor;../Lib/dev;../Bsp;../Middlewares/ST/ARM/DSP/Inc
@@ -359,7 +359,7 @@
- ../Core/Inc;../Drivers/STM32F4xx_HAL_Driver/Inc;../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy;../Middlewares/Third_Party/FreeRTOS/Source/include;../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS;../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F;../Drivers/CMSIS/Device/ST/STM32F4xx/Include;../Drivers/CMSIS/Include;..\Application\Task\Inc;../Application;../Application/Task/Inc;../Middlewares/ST/ARM/DSP/Inc;../modules/algorithm;../modules/imu;../modules/imu/qekf;../modules/sensor;../modules/comms;../modules/motor;../modules/control;../modules/dev
+ ../Core/Inc;../Drivers/STM32F4xx_HAL_Driver/Inc;../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy;../Middlewares/Third_Party/FreeRTOS/Source/include;../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS;../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F;../Drivers/CMSIS/Device/ST/STM32F4xx/Include;../Drivers/CMSIS/Include;../App;../App/system;../App/cmd;../App/gimbal;../App/shoot;../App/vision;../App/comm;../App/referee;../Lib/algorithm;../Lib/motor;../Lib/imu;../Lib/imu/qekf;../Lib/sensor;../Lib/dev;../Bsp;../Middlewares/ST/ARM/DSP/Inc
@@ -2327,187 +2327,237 @@
- Application/Task
+ App/system
can_task.c
1
- ..\Application\Task\Src\can_task.c
+ ..\App\system\can_task.c
app_tasks.h
5
- ..\Application\Task\Inc\app_tasks.h
+ ..\App\system\app_tasks.h
monitor_task.c
1
- ..\Application\Task\Src\monitor_task.c
-
-
- robot_cmd_task.c
- 1
- ..\Application\Task\Src\robot_cmd_task.c
-
-
- robot_cmd_task.h
- 5
- ..\Application\Task\Inc\robot_cmd_task.h
-
-
- c_comm_task.c
- 1
- ..\Application\Task\Src\c_comm_task.c
-
-
- referee_task.c
- 1
- ..\Application\Task\Src\referee_task.c
-
-
- referee_task.h
- 5
- ..\Application\Task\Inc\referee_task.h
-
-
- debug_task.c
- 1
- ..\Application\Task\Src\debug_task.c
-
-
- debug_task.h
- 5
- ..\Application\Task\Inc\debug_task.h
+ ..\App\system\monitor_task.c
imu_task.c
1
- ..\Application\Task\Src\imu_task.c
+ ..\App\system\imu_task.c
- gimbal_task.c
+ debug_task.c
1
- ..\Application\Task\Src\gimbal_task.c
+ ..\App\system\debug_task.c
- shoot_task.c
- 1
- ..\Application\Task\Src\shoot_task.c
+ debug_task.h
+ 5
+ ..\App\system\debug_task.h
- Modules
+ App/cmd
- pid.c
+ robot_cmd_task.c
1
- ..\modules\algorithm\pid.c
+ ..\App\cmd\robot_cmd_task.c
- filter.c
- 1
- ..\modules\algorithm\filter.c
-
-
- dji_motor.c
- 1
- ..\modules\motor\dji_motor.c
+ robot_cmd_task.h
+ 5
+ ..\App\cmd\robot_cmd_task.h
dr16.c
1
- ..\modules\comms\dr16.c
-
-
- referee.c
- 1
- ..\modules\comms\referee.c
-
-
- vision.c
- 1
- ..\modules\comms\vision.c
-
-
- led.c
- 1
- ..\modules\dev\led.c
-
-
- buzzer.c
- 1
- ..\modules\dev\buzzer.c
-
-
- c_comm.c
- 1
- ..\modules\comms\c_comm.c
-
-
- bmi088.c
- 1
- ..\modules\sensor\bmi088.c
-
-
- ist8310.c
- 1
- ..\modules\sensor\ist8310.c
-
-
- attitude.c
- 1
- ..\modules\imu\attitude.c
-
-
- kalman_filter.c
- 1
- ..\modules\imu\qekf\kalman_filter.c
-
-
- QuaternionEKF.c
- 1
- ..\modules\imu\qekf\QuaternionEKF.c
-
-
- ins.c
- 1
- ..\modules\imu\ins.c
-
-
- gimbal.c
- 1
- ..\modules\control\gimbal.c
-
-
- shoot.c
- 1
- ..\modules\control\shoot.c
+ ..\App\cmd\dr16.c
- BSP
+ App/gimbal
+
+
+ gimbal_task.c
+ 1
+ ..\App\gimbal\gimbal_task.c
+
+
+ gimbal.c
+ 1
+ ..\App\gimbal\gimbal.c
+
+
+
+
+ App/shoot
+
+
+ shoot_task.c
+ 1
+ ..\App\shoot\shoot_task.c
+
+
+ shoot.c
+ 1
+ ..\App\shoot\shoot.c
+
+
+
+
+ App/vision
+
+
+ vision.c
+ 1
+ ..\App\vision\vision.c
+
+
+
+
+ App/comm
+
+
+ c_comm_task.c
+ 1
+ ..\App\comm\c_comm_task.c
+
+
+ c_comm.c
+ 1
+ ..\App\comm\c_comm.c
+
+
+
+
+ App/referee
+
+
+ referee_task.c
+ 1
+ ..\App\referee\referee_task.c
+
+
+ referee_task.h
+ 5
+ ..\App\referee\referee_task.h
+
+
+ referee.c
+ 1
+ ..\App\referee\referee.c
+
+
+
+
+ Lib/algorithm
+
+
+ pid.c
+ 1
+ ..\Lib\algorithm\pid.c
+
+
+ filter.c
+ 1
+ ..\Lib\algorithm\filter.c
+
+
+
+
+ Lib/motor
+
+
+ dji_motor.c
+ 1
+ ..\Lib\motor\dji_motor.c
+
+
+
+
+ Lib/imu
+
+
+ attitude.c
+ 1
+ ..\Lib\imu\attitude.c
+
+
+ ins.c
+ 1
+ ..\Lib\imu\ins.c
+
+
+ kalman_filter.c
+ 1
+ ..\Lib\imu\qekf\kalman_filter.c
+
+
+ QuaternionEKF.c
+ 1
+ ..\Lib\imu\qekf\QuaternionEKF.c
+
+
+
+
+ Lib/sensor
+
+
+ bmi088.c
+ 1
+ ..\Lib\sensor\bmi088.c
+
+
+ ist8310.c
+ 1
+ ..\Lib\sensor\ist8310.c
+
+
+
+
+ Lib/dev
+
+
+ led.c
+ 1
+ ..\Lib\dev\led.c
+
+
+ buzzer.c
+ 1
+ ..\Lib\dev\buzzer.c
+
+
+
+
+ Bsp
bsp_can.c
1
- ..\Bsp\Src\bsp_can.c
+ ..\Bsp\bsp_can.c
bsp_usart.c
1
- ..\Bsp\Src\bsp_usart.c
+ ..\Bsp\bsp_usart.c
bsp_can.h
5
- ..\Bsp\Inc\bsp_can.h
+ ..\Bsp\bsp_can.h
bsp_usart.h
5
- ..\Bsp\Inc\bsp_usart.h
+ ..\Bsp\bsp_usart.h
diff --git a/云台/README.md b/云台/README.md
index 1e27c42..646bf90 100644
--- a/云台/README.md
+++ b/云台/README.md
@@ -13,7 +13,7 @@
- **图传链路 / 裁判系统**:USART6(3pin 口)
- **DR16 遥控器**:USART3
- **板间通讯主控**:云台把世界系 yaw(`0x1A9`)与摇杆/控制状态(`0x149`/`0x189`)发给底盘
-- **视觉上位机接口**:USART1(4pin 口),自瞄协议已接入(`modules/comms/vision.c`,帧格式与进入条件见根 README §6.5)
+- **视觉上位机接口**:USART1(4pin 口),自瞄协议已接入(`App/vision/vision.c`,帧格式与进入条件见根 README §6.5)
## 编译宏
@@ -25,15 +25,15 @@ USE_HAL_DRIVER, STM32F407xx, ARM_MATH_CM4, ROBOT_TYPE_GIMBAL
| 项 | 位置 |
| --- | --- |
-| `gimbal` 云台双环 + 装配符号自检 | `modules/control/gimbal.c` |
-| `shoot` 摩擦轮/拨弹 | `modules/control/shoot.c` |
-| `vision` 视觉自瞄协议 | `modules/comms/vision.c` |
-| `gimbal_task` / `shoot_task` | `Application/Task/Src/` |
+| `gimbal` 云台双环 + 装配符号自检 | `App/gimbal/gimbal.c` |
+| `shoot` 摩擦轮/拨弹 | `App/shoot/shoot.c` |
+| `vision` 视觉自瞄协议 | `App/vision/vision.c` |
+| `gimbal_task` / `shoot_task` | `App/gimbal/gimbal_task.c`、`App/shoot/shoot_task.c` |
| DR16 遥控器、视觉串口 | `Bsp/bsp_usart.c` 的 `usart3_init` / `usart1_*` |
-| 板间帧 0x149 / 0x189 / 0x1A9 的**发送**侧 | `modules/comms/c_comm.c` |
-| IST8310 磁力计与本板 IMU 恒温 | `modules/imu/attitude.c`(双板都有,云台用于云台控制) |
+| 板间帧 0x149 / 0x189 / 0x1A9 的**发送**侧 | `App/comm/c_comm.c` |
+| IST8310 磁力计与本板 IMU 恒温 | `Lib/imu/attitude.c`(双板都有,云台用于云台控制) |
-底盘板有的 `control/chassis.c` 与 `chassis_task` 本工程没有(所以两棵树的 `modules/control/` 内容不同,属预期差异)。
+底盘板有的 `App/chassis/`(`chassis.c` 与 `chassis_task.c`)本工程没有,属预期差异。
## 上电时本板特有的行为
diff --git a/底盘/modules/control/chassis.c b/底盘/App/chassis/chassis.c
similarity index 100%
rename from 底盘/modules/control/chassis.c
rename to 底盘/App/chassis/chassis.c
diff --git a/底盘/modules/control/chassis.h b/底盘/App/chassis/chassis.h
similarity index 100%
rename from 底盘/modules/control/chassis.h
rename to 底盘/App/chassis/chassis.h
diff --git a/底盘/Application/Task/Src/chassis_task.c b/底盘/App/chassis/chassis_task.c
similarity index 100%
rename from 底盘/Application/Task/Src/chassis_task.c
rename to 底盘/App/chassis/chassis_task.c
diff --git a/底盘/modules/control/hlj_pc.c b/底盘/App/chassis/hlj_pc.c
similarity index 100%
rename from 底盘/modules/control/hlj_pc.c
rename to 底盘/App/chassis/hlj_pc.c
diff --git a/底盘/modules/control/hlj_pc.h b/底盘/App/chassis/hlj_pc.h
similarity index 100%
rename from 底盘/modules/control/hlj_pc.h
rename to 底盘/App/chassis/hlj_pc.h
diff --git a/底盘/modules/dev/supercap.c b/底盘/App/chassis/supercap.c
similarity index 100%
rename from 底盘/modules/dev/supercap.c
rename to 底盘/App/chassis/supercap.c
diff --git a/底盘/modules/dev/supercap.h b/底盘/App/chassis/supercap.h
similarity index 100%
rename from 底盘/modules/dev/supercap.h
rename to 底盘/App/chassis/supercap.h
diff --git a/底盘/modules/comms/dr16.c b/底盘/App/cmd/dr16.c
similarity index 100%
rename from 底盘/modules/comms/dr16.c
rename to 底盘/App/cmd/dr16.c
diff --git a/底盘/modules/comms/dr16.h b/底盘/App/cmd/dr16.h
similarity index 100%
rename from 底盘/modules/comms/dr16.h
rename to 底盘/App/cmd/dr16.h
diff --git a/底盘/Application/Task/Src/robot_cmd_task.c b/底盘/App/cmd/robot_cmd_task.c
similarity index 100%
rename from 底盘/Application/Task/Src/robot_cmd_task.c
rename to 底盘/App/cmd/robot_cmd_task.c
diff --git a/底盘/Application/Task/Inc/robot_cmd_task.h b/底盘/App/cmd/robot_cmd_task.h
similarity index 100%
rename from 底盘/Application/Task/Inc/robot_cmd_task.h
rename to 底盘/App/cmd/robot_cmd_task.h
diff --git a/底盘/modules/comms/c_comm.c b/底盘/App/comm/c_comm.c
similarity index 100%
rename from 底盘/modules/comms/c_comm.c
rename to 底盘/App/comm/c_comm.c
diff --git a/底盘/modules/comms/c_comm.h b/底盘/App/comm/c_comm.h
similarity index 100%
rename from 底盘/modules/comms/c_comm.h
rename to 底盘/App/comm/c_comm.h
diff --git a/底盘/Application/Task/Src/c_comm_task.c b/底盘/App/comm/c_comm_task.c
similarity index 100%
rename from 底盘/Application/Task/Src/c_comm_task.c
rename to 底盘/App/comm/c_comm_task.c
diff --git a/底盘/modules/comms/referee.c b/底盘/App/referee/referee.c
similarity index 100%
rename from 底盘/modules/comms/referee.c
rename to 底盘/App/referee/referee.c
diff --git a/底盘/modules/comms/referee.h b/底盘/App/referee/referee.h
similarity index 100%
rename from 底盘/modules/comms/referee.h
rename to 底盘/App/referee/referee.h
diff --git a/底盘/Application/Task/Src/referee_task.c b/底盘/App/referee/referee_task.c
similarity index 100%
rename from 底盘/Application/Task/Src/referee_task.c
rename to 底盘/App/referee/referee_task.c
diff --git a/底盘/Application/Task/Inc/referee_task.h b/底盘/App/referee/referee_task.h
similarity index 100%
rename from 底盘/Application/Task/Inc/referee_task.h
rename to 底盘/App/referee/referee_task.h
diff --git a/底盘/modules/comms/referee_ui.c b/底盘/App/referee/referee_ui.c
similarity index 100%
rename from 底盘/modules/comms/referee_ui.c
rename to 底盘/App/referee/referee_ui.c
diff --git a/底盘/modules/comms/referee_ui.h b/底盘/App/referee/referee_ui.h
similarity index 100%
rename from 底盘/modules/comms/referee_ui.h
rename to 底盘/App/referee/referee_ui.h
diff --git a/底盘/Application/robot_param.h b/底盘/App/robot_param.h
similarity index 100%
rename from 底盘/Application/robot_param.h
rename to 底盘/App/robot_param.h
diff --git a/底盘/Application/robot_typedef.h b/底盘/App/robot_typedef.h
similarity index 100%
rename from 底盘/Application/robot_typedef.h
rename to 底盘/App/robot_typedef.h
diff --git a/底盘/Application/Task/Inc/app_tasks.h b/底盘/App/system/app_tasks.h
similarity index 100%
rename from 底盘/Application/Task/Inc/app_tasks.h
rename to 底盘/App/system/app_tasks.h
diff --git a/底盘/Application/Task/Src/can_task.c b/底盘/App/system/can_task.c
similarity index 100%
rename from 底盘/Application/Task/Src/can_task.c
rename to 底盘/App/system/can_task.c
diff --git a/底盘/Application/Task/Src/debug_task.c b/底盘/App/system/debug_task.c
similarity index 100%
rename from 底盘/Application/Task/Src/debug_task.c
rename to 底盘/App/system/debug_task.c
diff --git a/底盘/Application/Task/Inc/debug_task.h b/底盘/App/system/debug_task.h
similarity index 100%
rename from 底盘/Application/Task/Inc/debug_task.h
rename to 底盘/App/system/debug_task.h
diff --git a/底盘/Application/Task/Src/imu_task.c b/底盘/App/system/imu_task.c
similarity index 100%
rename from 底盘/Application/Task/Src/imu_task.c
rename to 底盘/App/system/imu_task.c
diff --git a/底盘/Application/Task/Src/monitor_task.c b/底盘/App/system/monitor_task.c
similarity index 100%
rename from 底盘/Application/Task/Src/monitor_task.c
rename to 底盘/App/system/monitor_task.c
diff --git a/底盘/Bsp/Src/bsp_can.c b/底盘/Bsp/bsp_can.c
similarity index 100%
rename from 底盘/Bsp/Src/bsp_can.c
rename to 底盘/Bsp/bsp_can.c
diff --git a/底盘/Bsp/Inc/bsp_can.h b/底盘/Bsp/bsp_can.h
similarity index 100%
rename from 底盘/Bsp/Inc/bsp_can.h
rename to 底盘/Bsp/bsp_can.h
diff --git a/底盘/Bsp/Src/bsp_usart.c b/底盘/Bsp/bsp_usart.c
similarity index 100%
rename from 底盘/Bsp/Src/bsp_usart.c
rename to 底盘/Bsp/bsp_usart.c
diff --git a/底盘/Bsp/Inc/bsp_usart.h b/底盘/Bsp/bsp_usart.h
similarity index 100%
rename from 底盘/Bsp/Inc/bsp_usart.h
rename to 底盘/Bsp/bsp_usart.h
diff --git a/底盘/modules/algorithm/filter.c b/底盘/Lib/algorithm/filter.c
similarity index 100%
rename from 底盘/modules/algorithm/filter.c
rename to 底盘/Lib/algorithm/filter.c
diff --git a/底盘/modules/algorithm/filter.h b/底盘/Lib/algorithm/filter.h
similarity index 100%
rename from 底盘/modules/algorithm/filter.h
rename to 底盘/Lib/algorithm/filter.h
diff --git a/底盘/modules/algorithm/pid.c b/底盘/Lib/algorithm/pid.c
similarity index 100%
rename from 底盘/modules/algorithm/pid.c
rename to 底盘/Lib/algorithm/pid.c
diff --git a/底盘/modules/algorithm/pid.h b/底盘/Lib/algorithm/pid.h
similarity index 100%
rename from 底盘/modules/algorithm/pid.h
rename to 底盘/Lib/algorithm/pid.h
diff --git a/底盘/modules/dev/buzzer.c b/底盘/Lib/dev/buzzer.c
similarity index 100%
rename from 底盘/modules/dev/buzzer.c
rename to 底盘/Lib/dev/buzzer.c
diff --git a/底盘/modules/dev/buzzer.h b/底盘/Lib/dev/buzzer.h
similarity index 100%
rename from 底盘/modules/dev/buzzer.h
rename to 底盘/Lib/dev/buzzer.h
diff --git a/底盘/modules/dev/led.c b/底盘/Lib/dev/led.c
similarity index 100%
rename from 底盘/modules/dev/led.c
rename to 底盘/Lib/dev/led.c
diff --git a/底盘/modules/dev/led.h b/底盘/Lib/dev/led.h
similarity index 100%
rename from 底盘/modules/dev/led.h
rename to 底盘/Lib/dev/led.h
diff --git a/底盘/modules/imu/attitude.c b/底盘/Lib/imu/attitude.c
similarity index 100%
rename from 底盘/modules/imu/attitude.c
rename to 底盘/Lib/imu/attitude.c
diff --git a/底盘/modules/imu/attitude.h b/底盘/Lib/imu/attitude.h
similarity index 100%
rename from 底盘/modules/imu/attitude.h
rename to 底盘/Lib/imu/attitude.h
diff --git a/底盘/modules/imu/ins.c b/底盘/Lib/imu/ins.c
similarity index 100%
rename from 底盘/modules/imu/ins.c
rename to 底盘/Lib/imu/ins.c
diff --git a/底盘/modules/imu/ins.h b/底盘/Lib/imu/ins.h
similarity index 100%
rename from 底盘/modules/imu/ins.h
rename to 底盘/Lib/imu/ins.h
diff --git a/底盘/modules/imu/qekf/QuaternionEKF.c b/底盘/Lib/imu/qekf/QuaternionEKF.c
similarity index 100%
rename from 底盘/modules/imu/qekf/QuaternionEKF.c
rename to 底盘/Lib/imu/qekf/QuaternionEKF.c
diff --git a/底盘/modules/imu/qekf/QuaternionEKF.h b/底盘/Lib/imu/qekf/QuaternionEKF.h
similarity index 100%
rename from 底盘/modules/imu/qekf/QuaternionEKF.h
rename to 底盘/Lib/imu/qekf/QuaternionEKF.h
diff --git a/底盘/modules/imu/qekf/kalman_filter.c b/底盘/Lib/imu/qekf/kalman_filter.c
similarity index 100%
rename from 底盘/modules/imu/qekf/kalman_filter.c
rename to 底盘/Lib/imu/qekf/kalman_filter.c
diff --git a/底盘/modules/imu/qekf/kalman_filter.h b/底盘/Lib/imu/qekf/kalman_filter.h
similarity index 100%
rename from 底盘/modules/imu/qekf/kalman_filter.h
rename to 底盘/Lib/imu/qekf/kalman_filter.h
diff --git a/底盘/modules/motor/dji_motor.c b/底盘/Lib/motor/dji_motor.c
similarity index 100%
rename from 底盘/modules/motor/dji_motor.c
rename to 底盘/Lib/motor/dji_motor.c
diff --git a/底盘/modules/motor/dji_motor.h b/底盘/Lib/motor/dji_motor.h
similarity index 100%
rename from 底盘/modules/motor/dji_motor.h
rename to 底盘/Lib/motor/dji_motor.h
diff --git a/底盘/modules/sensor/bmi088.c b/底盘/Lib/sensor/bmi088.c
similarity index 100%
rename from 底盘/modules/sensor/bmi088.c
rename to 底盘/Lib/sensor/bmi088.c
diff --git a/底盘/modules/sensor/bmi088.h b/底盘/Lib/sensor/bmi088.h
similarity index 100%
rename from 底盘/modules/sensor/bmi088.h
rename to 底盘/Lib/sensor/bmi088.h
diff --git a/底盘/modules/sensor/ist8310.c b/底盘/Lib/sensor/ist8310.c
similarity index 100%
rename from 底盘/modules/sensor/ist8310.c
rename to 底盘/Lib/sensor/ist8310.c
diff --git a/底盘/modules/sensor/ist8310.h b/底盘/Lib/sensor/ist8310.h
similarity index 100%
rename from 底盘/modules/sensor/ist8310.h
rename to 底盘/Lib/sensor/ist8310.h
diff --git a/底盘/MDK-ARM/Simba-ELCT-FrameWork.uvoptx b/底盘/MDK-ARM/Simba-ELCT-FrameWork.uvoptx
index 52d3c38..f5e8358 100644
--- a/底盘/MDK-ARM/Simba-ELCT-FrameWork.uvoptx
+++ b/底盘/MDK-ARM/Simba-ELCT-FrameWork.uvoptx
@@ -1027,7 +1027,7 @@
- Application/Task
+ App/system
0
0
0
@@ -1039,7 +1039,7 @@
0
0
0
- ..\Application\Task\Src\can_task.c
+ ..\App\system\can_task.c
can_task.c
0
0
@@ -1051,7 +1051,7 @@
0
0
0
- ..\Application\Task\Inc\app_tasks.h
+ ..\App\system\app_tasks.h
app_tasks.h
0
0
@@ -1063,7 +1063,7 @@
0
0
0
- ..\Application\Task\Src\monitor_task.c
+ ..\App\system\monitor_task.c
monitor_task.c
0
0
@@ -1075,383 +1075,447 @@
0
0
0
- ..\Application\Task\Src\robot_cmd_task.c
- robot_cmd_task.c
- 0
- 0
-
-
- 9
- 68
- 5
- 0
- 0
- 0
- ..\Application\Task\Inc\robot_cmd_task.h
- robot_cmd_task.h
- 0
- 0
-
-
- 9
- 69
- 1
- 0
- 0
- 0
- ..\Application\Task\Src\c_comm_task.c
- c_comm_task.c
- 0
- 0
-
-
- 9
- 70
- 1
- 0
- 0
- 0
- ..\Application\Task\Src\referee_task.c
- referee_task.c
- 0
- 0
-
-
- 9
- 71
- 5
- 0
- 0
- 0
- ..\Application\Task\Inc\referee_task.h
- referee_task.h
- 0
- 0
-
-
- 9
- 72
- 1
- 0
- 0
- 0
- ..\Application\Task\Src\imu_task.c
+ ..\App\system\imu_task.c
imu_task.c
0
0
9
- 73
+ 68
1
0
0
0
- ..\Application\Task\Src\debug_task.c
+ ..\App\system\debug_task.c
debug_task.c
0
0
9
- 74
+ 69
5
0
0
0
- ..\Application\Task\Inc\debug_task.h
+ ..\App\system\debug_task.h
debug_task.h
0
0
-
- 9
- 75
- 1
- 0
- 0
- 0
- ..\Application\Task\Src\chassis_task.c
- chassis_task.c
- 0
- 0
-
- Modules
+ App/cmd
0
0
0
0
10
- 76
+ 70
1
0
0
0
- ..\modules\algorithm\pid.c
- pid.c
+ ..\App\cmd\robot_cmd_task.c
+ robot_cmd_task.c
0
0
10
- 77
- 1
+ 71
+ 5
0
0
0
- ..\modules\algorithm\filter.c
- filter.c
+ ..\App\cmd\robot_cmd_task.h
+ robot_cmd_task.h
0
0
10
- 78
+ 72
1
0
0
0
- ..\modules\motor\dji_motor.c
- dji_motor.c
- 0
- 0
-
-
- 10
- 79
- 1
- 0
- 0
- 0
- ..\modules\comms\dr16.c
+ ..\App\cmd\dr16.c
dr16.c
0
0
+
+
+
+ App/chassis
+ 0
+ 0
+ 0
+ 0
- 10
- 80
+ 11
+ 73
1
0
0
0
- ..\modules\comms\referee.c
- referee.c
+ ..\App\chassis\chassis_task.c
+ chassis_task.c
0
0
- 10
- 81
+ 11
+ 74
1
0
0
0
- ..\modules\comms\referee_ui.c
- referee_ui.c
- 0
- 0
-
-
- 10
- 82
- 1
- 0
- 0
- 0
- ..\modules\dev\led.c
- led.c
- 0
- 0
-
-
- 10
- 83
- 1
- 0
- 0
- 0
- ..\modules\dev\buzzer.c
- buzzer.c
- 0
- 0
-
-
- 10
- 84
- 1
- 0
- 0
- 0
- ..\modules\comms\c_comm.c
- c_comm.c
- 0
- 0
-
-
- 10
- 85
- 1
- 0
- 0
- 0
- ..\modules\control\chassis.c
+ ..\App\chassis\chassis.c
chassis.c
0
0
- 10
- 86
+ 11
+ 75
1
0
0
0
- ..\modules\control\hlj_pc.c
+ ..\App\chassis\hlj_pc.c
hlj_pc.c
0
0
- 10
- 87
+ 11
+ 76
1
0
0
0
- ..\modules\dev\supercap.c
+ ..\App\chassis\supercap.c
supercap.c
0
0
-
- 10
- 88
- 1
- 0
- 0
- 0
- ..\modules\sensor\bmi088.c
- bmi088.c
- 0
- 0
-
-
- 10
- 89
- 1
- 0
- 0
- 0
- ..\modules\sensor\ist8310.c
- ist8310.c
- 0
- 0
-
-
- 10
- 90
- 1
- 0
- 0
- 0
- ..\modules\imu\attitude.c
- attitude.c
- 0
- 0
-
-
- 10
- 91
- 1
- 0
- 0
- 0
- ..\modules\imu\qekf\kalman_filter.c
- kalman_filter.c
- 0
- 0
-
-
- 10
- 92
- 1
- 0
- 0
- 0
- ..\modules\imu\qekf\QuaternionEKF.c
- QuaternionEKF.c
- 0
- 0
-
-
- 10
- 93
- 1
- 0
- 0
- 0
- ..\modules\imu\ins.c
- ins.c
- 0
- 0
-
- BSP
+ App/comm
0
0
0
0
- 11
+ 12
+ 77
+ 1
+ 0
+ 0
+ 0
+ ..\App\comm\c_comm_task.c
+ c_comm_task.c
+ 0
+ 0
+
+
+ 12
+ 78
+ 1
+ 0
+ 0
+ 0
+ ..\App\comm\c_comm.c
+ c_comm.c
+ 0
+ 0
+
+
+
+
+ App/referee
+ 0
+ 0
+ 0
+ 0
+
+ 13
+ 79
+ 1
+ 0
+ 0
+ 0
+ ..\App\referee\referee_task.c
+ referee_task.c
+ 0
+ 0
+
+
+ 13
+ 80
+ 5
+ 0
+ 0
+ 0
+ ..\App\referee\referee_task.h
+ referee_task.h
+ 0
+ 0
+
+
+ 13
+ 81
+ 1
+ 0
+ 0
+ 0
+ ..\App\referee\referee.c
+ referee.c
+ 0
+ 0
+
+
+ 13
+ 82
+ 1
+ 0
+ 0
+ 0
+ ..\App\referee\referee_ui.c
+ referee_ui.c
+ 0
+ 0
+
+
+
+
+ Lib/algorithm
+ 0
+ 0
+ 0
+ 0
+
+ 14
+ 83
+ 1
+ 0
+ 0
+ 0
+ ..\Lib\algorithm\pid.c
+ pid.c
+ 0
+ 0
+
+
+ 14
+ 84
+ 1
+ 0
+ 0
+ 0
+ ..\Lib\algorithm\filter.c
+ filter.c
+ 0
+ 0
+
+
+
+
+ Lib/motor
+ 0
+ 0
+ 0
+ 0
+
+ 15
+ 85
+ 1
+ 0
+ 0
+ 0
+ ..\Lib\motor\dji_motor.c
+ dji_motor.c
+ 0
+ 0
+
+
+
+
+ Lib/imu
+ 0
+ 0
+ 0
+ 0
+
+ 16
+ 86
+ 1
+ 0
+ 0
+ 0
+ ..\Lib\imu\attitude.c
+ attitude.c
+ 0
+ 0
+
+
+ 16
+ 87
+ 1
+ 0
+ 0
+ 0
+ ..\Lib\imu\ins.c
+ ins.c
+ 0
+ 0
+
+
+ 16
+ 88
+ 1
+ 0
+ 0
+ 0
+ ..\Lib\imu\qekf\kalman_filter.c
+ kalman_filter.c
+ 0
+ 0
+
+
+ 16
+ 89
+ 1
+ 0
+ 0
+ 0
+ ..\Lib\imu\qekf\QuaternionEKF.c
+ QuaternionEKF.c
+ 0
+ 0
+
+
+
+
+ Lib/sensor
+ 0
+ 0
+ 0
+ 0
+
+ 17
+ 90
+ 1
+ 0
+ 0
+ 0
+ ..\Lib\sensor\bmi088.c
+ bmi088.c
+ 0
+ 0
+
+
+ 17
+ 91
+ 1
+ 0
+ 0
+ 0
+ ..\Lib\sensor\ist8310.c
+ ist8310.c
+ 0
+ 0
+
+
+
+
+ Lib/dev
+ 0
+ 0
+ 0
+ 0
+
+ 18
+ 92
+ 1
+ 0
+ 0
+ 0
+ ..\Lib\dev\led.c
+ led.c
+ 0
+ 0
+
+
+ 18
+ 93
+ 1
+ 0
+ 0
+ 0
+ ..\Lib\dev\buzzer.c
+ buzzer.c
+ 0
+ 0
+
+
+
+
+ Bsp
+ 0
+ 0
+ 0
+ 0
+
+ 19
94
1
0
0
0
- ..\Bsp\Src\bsp_can.c
+ ..\Bsp\bsp_can.c
bsp_can.c
0
0
- 11
+ 19
95
1
0
0
0
- ..\Bsp\Src\bsp_usart.c
+ ..\Bsp\bsp_usart.c
bsp_usart.c
0
0
- 11
+ 19
96
5
0
0
0
- ..\Bsp\Inc\bsp_can.h
+ ..\Bsp\bsp_can.h
bsp_can.h
0
0
- 11
+ 19
97
5
0
0
0
- ..\Bsp\Inc\bsp_usart.h
+ ..\Bsp\bsp_usart.h
bsp_usart.h
0
0
@@ -1465,7 +1529,7 @@
0
0
- 12
+ 20
98
4
0
diff --git a/底盘/MDK-ARM/Simba-ELCT-FrameWork.uvprojx b/底盘/MDK-ARM/Simba-ELCT-FrameWork.uvprojx
index 5eafee1..730c91a 100644
--- a/底盘/MDK-ARM/Simba-ELCT-FrameWork.uvprojx
+++ b/底盘/MDK-ARM/Simba-ELCT-FrameWork.uvprojx
@@ -341,7 +341,7 @@
USE_HAL_DRIVER,STM32F407xx,ARM_MATH_CM4,ROBOT_TYPE_CHASSIS
- ../Core/Inc;../Drivers/STM32F4xx_HAL_Driver/Inc;../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy;../Middlewares/Third_Party/FreeRTOS/Source/include;../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS;../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F;../Drivers/CMSIS/Device/ST/STM32F4xx/Include;../Drivers/CMSIS/Include;../USB_DEVICE/App;../USB_DEVICE/Target;../Middlewares/ST/STM32_USB_Device_Library/Core/Inc;../Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc;../Application/Task/;../Bsp/Inc;../Application;../Application/Task/Inc;../Middlewares/ST/ARM/DSP/Inc;../modules/algorithm;../modules/imu;../modules/imu/qekf;../modules/sensor;../modules/comms;../modules/motor;../modules/control;../modules/dev
+ ../Core/Inc;../Drivers/STM32F4xx_HAL_Driver/Inc;../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy;../Middlewares/Third_Party/FreeRTOS/Source/include;../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS;../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F;../Drivers/CMSIS/Device/ST/STM32F4xx/Include;../Drivers/CMSIS/Include;../USB_DEVICE/App;../USB_DEVICE/Target;../Middlewares/ST/STM32_USB_Device_Library/Core/Inc;../Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc;../App;../App/system;../App/cmd;../App/chassis;../App/comm;../App/referee;../Lib/algorithm;../Lib/motor;../Lib/imu;../Lib/imu/qekf;../Lib/sensor;../Lib/dev;../Bsp;../Middlewares/ST/ARM/DSP/Inc
@@ -359,7 +359,7 @@
- ../Core/Inc;../Drivers/STM32F4xx_HAL_Driver/Inc;../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy;../Middlewares/Third_Party/FreeRTOS/Source/include;../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS;../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F;../Drivers/CMSIS/Device/ST/STM32F4xx/Include;../Drivers/CMSIS/Include;..\Application\Task\Inc;../Application;../Application/Task/Inc;../Middlewares/ST/ARM/DSP/Inc;../modules/algorithm;../modules/imu;../modules/imu/qekf;../modules/sensor;../modules/comms;../modules/motor;../modules/control;../modules/dev
+ ../Core/Inc;../Drivers/STM32F4xx_HAL_Driver/Inc;../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy;../Middlewares/Third_Party/FreeRTOS/Source/include;../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS;../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F;../Drivers/CMSIS/Device/ST/STM32F4xx/Include;../Drivers/CMSIS/Include;../App;../App/system;../App/cmd;../App/chassis;../App/comm;../App/referee;../Lib/algorithm;../Lib/motor;../Lib/imu;../Lib/imu/qekf;../Lib/sensor;../Lib/dev;../Bsp;../Middlewares/ST/ARM/DSP/Inc
@@ -2271,187 +2271,227 @@
- Application/Task
+ App/system
can_task.c
1
- ..\Application\Task\Src\can_task.c
+ ..\App\system\can_task.c
app_tasks.h
5
- ..\Application\Task\Inc\app_tasks.h
+ ..\App\system\app_tasks.h
monitor_task.c
1
- ..\Application\Task\Src\monitor_task.c
-
-
- robot_cmd_task.c
- 1
- ..\Application\Task\Src\robot_cmd_task.c
-
-
- robot_cmd_task.h
- 5
- ..\Application\Task\Inc\robot_cmd_task.h
-
-
- c_comm_task.c
- 1
- ..\Application\Task\Src\c_comm_task.c
-
-
- referee_task.c
- 1
- ..\Application\Task\Src\referee_task.c
-
-
- referee_task.h
- 5
- ..\Application\Task\Inc\referee_task.h
+ ..\App\system\monitor_task.c
imu_task.c
1
- ..\Application\Task\Src\imu_task.c
+ ..\App\system\imu_task.c
debug_task.c
1
- ..\Application\Task\Src\debug_task.c
+ ..\App\system\debug_task.c
debug_task.h
5
- ..\Application\Task\Inc\debug_task.h
-
-
- chassis_task.c
- 1
- ..\Application\Task\Src\chassis_task.c
+ ..\App\system\debug_task.h
- Modules
+ App/cmd
- pid.c
+ robot_cmd_task.c
1
- ..\modules\algorithm\pid.c
+ ..\App\cmd\robot_cmd_task.c
- filter.c
- 1
- ..\modules\algorithm\filter.c
-
-
- dji_motor.c
- 1
- ..\modules\motor\dji_motor.c
+ robot_cmd_task.h
+ 5
+ ..\App\cmd\robot_cmd_task.h
dr16.c
1
- ..\modules\comms\dr16.c
-
-
- referee.c
- 1
- ..\modules\comms\referee.c
-
-
- referee_ui.c
- 1
- ..\modules\comms\referee_ui.c
-
-
- led.c
- 1
- ..\modules\dev\led.c
-
-
- buzzer.c
- 1
- ..\modules\dev\buzzer.c
-
-
- c_comm.c
- 1
- ..\modules\comms\c_comm.c
-
-
- chassis.c
- 1
- ..\modules\control\chassis.c
-
-
- hlj_pc.c
- 1
- ..\modules\control\hlj_pc.c
-
-
- supercap.c
- 1
- ..\modules\dev\supercap.c
-
-
- bmi088.c
- 1
- ..\modules\sensor\bmi088.c
-
-
- ist8310.c
- 1
- ..\modules\sensor\ist8310.c
-
-
- attitude.c
- 1
- ..\modules\imu\attitude.c
-
-
- kalman_filter.c
- 1
- ..\modules\imu\qekf\kalman_filter.c
-
-
- QuaternionEKF.c
- 1
- ..\modules\imu\qekf\QuaternionEKF.c
-
-
- ins.c
- 1
- ..\modules\imu\ins.c
+ ..\App\cmd\dr16.c
- BSP
+ App/chassis
+
+
+ chassis_task.c
+ 1
+ ..\App\chassis\chassis_task.c
+
+
+ chassis.c
+ 1
+ ..\App\chassis\chassis.c
+
+
+ hlj_pc.c
+ 1
+ ..\App\chassis\hlj_pc.c
+
+
+ supercap.c
+ 1
+ ..\App\chassis\supercap.c
+
+
+
+
+ App/comm
+
+
+ c_comm_task.c
+ 1
+ ..\App\comm\c_comm_task.c
+
+
+ c_comm.c
+ 1
+ ..\App\comm\c_comm.c
+
+
+
+
+ App/referee
+
+
+ referee_task.c
+ 1
+ ..\App\referee\referee_task.c
+
+
+ referee_task.h
+ 5
+ ..\App\referee\referee_task.h
+
+
+ referee.c
+ 1
+ ..\App\referee\referee.c
+
+
+ referee_ui.c
+ 1
+ ..\App\referee\referee_ui.c
+
+
+
+
+ Lib/algorithm
+
+
+ pid.c
+ 1
+ ..\Lib\algorithm\pid.c
+
+
+ filter.c
+ 1
+ ..\Lib\algorithm\filter.c
+
+
+
+
+ Lib/motor
+
+
+ dji_motor.c
+ 1
+ ..\Lib\motor\dji_motor.c
+
+
+
+
+ Lib/imu
+
+
+ attitude.c
+ 1
+ ..\Lib\imu\attitude.c
+
+
+ ins.c
+ 1
+ ..\Lib\imu\ins.c
+
+
+ kalman_filter.c
+ 1
+ ..\Lib\imu\qekf\kalman_filter.c
+
+
+ QuaternionEKF.c
+ 1
+ ..\Lib\imu\qekf\QuaternionEKF.c
+
+
+
+
+ Lib/sensor
+
+
+ bmi088.c
+ 1
+ ..\Lib\sensor\bmi088.c
+
+
+ ist8310.c
+ 1
+ ..\Lib\sensor\ist8310.c
+
+
+
+
+ Lib/dev
+
+
+ led.c
+ 1
+ ..\Lib\dev\led.c
+
+
+ buzzer.c
+ 1
+ ..\Lib\dev\buzzer.c
+
+
+
+
+ Bsp
bsp_can.c
1
- ..\Bsp\Src\bsp_can.c
+ ..\Bsp\bsp_can.c
bsp_usart.c
1
- ..\Bsp\Src\bsp_usart.c
+ ..\Bsp\bsp_usart.c
bsp_can.h
5
- ..\Bsp\Inc\bsp_can.h
+ ..\Bsp\bsp_can.h
bsp_usart.h
5
- ..\Bsp\Inc\bsp_usart.h
+ ..\Bsp\bsp_usart.h
diff --git a/底盘/README.md b/底盘/README.md
index bf5f878..aee1eb2 100644
--- a/底盘/README.md
+++ b/底盘/README.md
@@ -26,11 +26,11 @@ USE_HAL_DRIVER, STM32F407xx, ARM_MATH_CM4, ROBOT_TYPE_CHASSIS
| 项 | 位置 |
| --- | --- |
-| `chassis` 麦轮解算 + 轮速环 + 跟随 + 功率限制 | `modules/control/chassis.c` |
-| `chassis_task` | `Application/Task/Src/chassis_task.c` |
-| 板间帧 0x149/0x189/0x1A9 的**接收**侧与 0x019 的发送侧 | `modules/comms/c_comm.c` |
+| `chassis` 麦轮解算 + 轮速环 + 跟随 + 功率限制 | `App/chassis/chassis.c` |
+| `chassis_task` | `App/chassis/chassis_task.c` |
+| 板间帧 0x149/0x189/0x1A9 的**接收**侧与 0x019 的发送侧 | `App/comm/c_comm.c` |
-云台板有的 `control/gimbal.c`、`control/shoot.c` 与对应任务本工程没有(所以两棵树的 `modules/control/` 内容不同,属预期差异)。
+云台板有的 `App/gimbal/`、`App/shoot/`、`App/vision/` 本工程没有,属预期差异。
## 上电时本板特有的行为