refactor(modules): 按角色重排 modules/ 目录,消除命名不一致
原 modules/ 下目录大小写混用(BMI088/BUZZER/DR16/IST8310/LED/PID 为大写,
attitude/c_comm/filter/gimbal/ins/motor/referee/shoot 为小写),且把第三方
移植代码(QuaternionEKF/kalman_filter)与本工程封装(ins)混在同一目录。
新结构(全部小写,按角色分层,第三方代码单独隔离):
modules/
algorithm/ pid.c/h filter.c/h 通用算法
imu/ attitude.c/h ins.c/h 姿态与惯导封装
imu/qekf/ QuaternionEKF.c/h kalman_filter.c/h
(移植自 Wang Hongxi INS 例程)
sensor/ bmi088.c/h ist8310.c/h 板载传感器驱动
comms/ dr16.c/h c_comm.c/h referee.c/h
motor/ dji_motor.c/h 电机抽象
control/ gimbal.c/h shoot.c/h 整车控制逻辑
(底盘为 chassis.c/h)
dev/ led.c/h buzzer.c/h 板级指示/发声
共移动 58 个文件(每板 29 个),旧目录全部删除。
工程文件同步(每个工程各 2 个):
- .uvprojx: Modules 分组 16 个 <FilePath> 改为新路径;
2 个非空 <IncludePath> 元素:15 个旧模块路径收敛为 8 个新目录,
并顺带删除陈旧项 ../modules/AHRS(目录根本不存在,legacy 时代残留)
与冗余项 ..\bsp(与 ../Bsp/Inc 重复)
- .uvoptx: 16 个 <PathWithFileName> 同步
关于"为什么不用改源码": Keil 的 include 靠 IncludePath 解析,本工程所有
#include 都是纯文件名形式(无路径限定),所以移动目录只需改工程配置。
另外 .h 完全不登记在工程里(只有 16 个 .c 被登记),故头文件只需移动。
回归验证(无法在此环境编译,用等价判据):
- 两个工程引用的 98 / 95 个 <FilePath> 全部真实存在
- 磁盘上 47 / 45 个 .c 全部仍被工程引用 —— 即没有任何文件掉出编译
- 2 个 IncludePath 元素均含全部 8 个新模块目录,无旧路径残留
- 所有 IncludePath 指向的目录均真实存在
- .uvprojx/.uvoptx XML 良构
- 两棵树结构一致(chassis/gimbal 等板级差异符合预期)
⚠️ 仍需在 Keil 里点一次编译确认(见 README 的构建章节)。
This commit is contained in:
1 parent
3e5e5e3f95
commit
e3d432f3b5
62 files changed
+62
-62
No files matched your search
@@ -1215,7 +1215,7 @@
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\modules\PID\pid.c</PathWithFileName>
|
||||
<PathWithFileName>..\modules\algorithm\pid.c</PathWithFileName>
|
||||
<FilenameWithoutPath>pid.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
@@ -1227,7 +1227,7 @@
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\modules\filter\filter.c</PathWithFileName>
|
||||
<PathWithFileName>..\modules\algorithm\filter.c</PathWithFileName>
|
||||
<FilenameWithoutPath>filter.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
@@ -1251,7 +1251,7 @@
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\modules\DR16\dr16.c</PathWithFileName>
|
||||
<PathWithFileName>..\modules\comms\dr16.c</PathWithFileName>
|
||||
<FilenameWithoutPath>dr16.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
@@ -1263,7 +1263,7 @@
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\modules\referee\referee.c</PathWithFileName>
|
||||
<PathWithFileName>..\modules\comms\referee.c</PathWithFileName>
|
||||
<FilenameWithoutPath>referee.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
@@ -1275,7 +1275,7 @@
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\modules\LED\led.c</PathWithFileName>
|
||||
<PathWithFileName>..\modules\dev\led.c</PathWithFileName>
|
||||
<FilenameWithoutPath>led.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
@@ -1287,7 +1287,7 @@
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\modules\BUZZER\buzzer.c</PathWithFileName>
|
||||
<PathWithFileName>..\modules\dev\buzzer.c</PathWithFileName>
|
||||
<FilenameWithoutPath>buzzer.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
@@ -1299,7 +1299,7 @@
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\modules\c_comm\c_comm.c</PathWithFileName>
|
||||
<PathWithFileName>..\modules\comms\c_comm.c</PathWithFileName>
|
||||
<FilenameWithoutPath>c_comm.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
@@ -1311,7 +1311,7 @@
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\modules\BMI088\bmi088.c</PathWithFileName>
|
||||
<PathWithFileName>..\modules\sensor\bmi088.c</PathWithFileName>
|
||||
<FilenameWithoutPath>bmi088.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
@@ -1323,7 +1323,7 @@
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\modules\IST8310\ist8310.c</PathWithFileName>
|
||||
<PathWithFileName>..\modules\sensor\ist8310.c</PathWithFileName>
|
||||
<FilenameWithoutPath>ist8310.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
@@ -1335,7 +1335,7 @@
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\modules\attitude\attitude.c</PathWithFileName>
|
||||
<PathWithFileName>..\modules\imu\attitude.c</PathWithFileName>
|
||||
<FilenameWithoutPath>attitude.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
@@ -1347,7 +1347,7 @@
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\modules\ins\kalman_filter.c</PathWithFileName>
|
||||
<PathWithFileName>..\modules\imu\qekf\kalman_filter.c</PathWithFileName>
|
||||
<FilenameWithoutPath>kalman_filter.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
@@ -1359,7 +1359,7 @@
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\modules\ins\QuaternionEKF.c</PathWithFileName>
|
||||
<PathWithFileName>..\modules\imu\qekf\QuaternionEKF.c</PathWithFileName>
|
||||
<FilenameWithoutPath>QuaternionEKF.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
@@ -1371,7 +1371,7 @@
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\modules\ins\ins.c</PathWithFileName>
|
||||
<PathWithFileName>..\modules\imu\ins.c</PathWithFileName>
|
||||
<FilenameWithoutPath>ins.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
@@ -1383,7 +1383,7 @@
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\modules\gimbal\gimbal.c</PathWithFileName>
|
||||
<PathWithFileName>..\modules\control\gimbal.c</PathWithFileName>
|
||||
<FilenameWithoutPath>gimbal.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
@@ -1395,7 +1395,7 @@
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\modules\shoot\shoot.c</PathWithFileName>
|
||||
<PathWithFileName>..\modules\control\shoot.c</PathWithFileName>
|
||||
<FilenameWithoutPath>shoot.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
|
||||
@@ -341,7 +341,7 @@
|
||||
<MiscControls></MiscControls>
|
||||
<Define>USE_HAL_DRIVER,STM32F407xx,ARM_MATH_CM4,ROBOT_TYPE_GIMBAL</Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath>../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;../modules/PID;../modules/filter;../modules/motor;../modules/DR16;../modules/referee;../modules/LED;../modules/BUZZER;../modules/c_comm;../modules/BMI088;../modules/IST8310;../modules/AHRS;../modules/attitude;../modules/gimbal;../modules/shoot;../modules/ins;../Middlewares/ST/ARM/DSP/Inc</IncludePath>
|
||||
<IncludePath>../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</IncludePath>
|
||||
</VariousControls>
|
||||
</Cads>
|
||||
<Aads>
|
||||
@@ -359,7 +359,7 @@
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath>../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;..\bsp;../Application;../Application/Task/Inc;../modules/PID;../modules/filter;../modules/motor;../modules/DR16;../modules/referee;../modules/LED;../modules/BUZZER;../modules/c_comm;../modules/BMI088;../modules/IST8310;../modules/AHRS;../modules/attitude;../modules/gimbal;../modules/shoot;../modules/ins;../Middlewares/ST/ARM/DSP/Inc</IncludePath>
|
||||
<IncludePath>../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</IncludePath>
|
||||
</VariousControls>
|
||||
</Aads>
|
||||
<LDads>
|
||||
@@ -2402,12 +2402,12 @@
|
||||
<File>
|
||||
<FileName>pid.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\modules\PID\pid.c</FilePath>
|
||||
<FilePath>..\modules\algorithm\pid.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>filter.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\modules\filter\filter.c</FilePath>
|
||||
<FilePath>..\modules\algorithm\filter.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>dji_motor.c</FileName>
|
||||
@@ -2417,67 +2417,67 @@
|
||||
<File>
|
||||
<FileName>dr16.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\modules\DR16\dr16.c</FilePath>
|
||||
<FilePath>..\modules\comms\dr16.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>referee.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\modules\referee\referee.c</FilePath>
|
||||
<FilePath>..\modules\comms\referee.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>led.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\modules\LED\led.c</FilePath>
|
||||
<FilePath>..\modules\dev\led.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>buzzer.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\modules\BUZZER\buzzer.c</FilePath>
|
||||
<FilePath>..\modules\dev\buzzer.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>c_comm.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\modules\c_comm\c_comm.c</FilePath>
|
||||
<FilePath>..\modules\comms\c_comm.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>bmi088.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\modules\BMI088\bmi088.c</FilePath>
|
||||
<FilePath>..\modules\sensor\bmi088.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>ist8310.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\modules\IST8310\ist8310.c</FilePath>
|
||||
<FilePath>..\modules\sensor\ist8310.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>attitude.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\modules\attitude\attitude.c</FilePath>
|
||||
<FilePath>..\modules\imu\attitude.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>kalman_filter.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\modules\ins\kalman_filter.c</FilePath>
|
||||
<FilePath>..\modules\imu\qekf\kalman_filter.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>QuaternionEKF.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\modules\ins\QuaternionEKF.c</FilePath>
|
||||
<FilePath>..\modules\imu\qekf\QuaternionEKF.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>ins.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\modules\ins\ins.c</FilePath>
|
||||
<FilePath>..\modules\imu\ins.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>gimbal.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\modules\gimbal\gimbal.c</FilePath>
|
||||
<FilePath>..\modules\control\gimbal.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>shoot.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\modules\shoot\shoot.c</FilePath>
|
||||
<FilePath>..\modules\control\shoot.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user