底盘
This commit is contained in:
parent
17bb7459b6
commit
252ddc04df
File diff suppressed because one or more lines are too long
@ -10,7 +10,7 @@
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc; *.md</tExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
@ -26,7 +26,7 @@
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<TargetOption>
|
||||
<CLKADS>12000000</CLKADS>
|
||||
<CLKADS>25000000</CLKADS>
|
||||
<OPTTT>
|
||||
<gFlags>1</gFlags>
|
||||
<BeepAtEnd>1</BeepAtEnd>
|
||||
@ -93,7 +93,7 @@
|
||||
<tRbreak>1</tRbreak>
|
||||
<tRwatch>1</tRwatch>
|
||||
<tRmem>1</tRmem>
|
||||
<tRfunc>1</tRfunc>
|
||||
<tRfunc>0</tRfunc>
|
||||
<tRbox>1</tRbox>
|
||||
<tRtrace>1</tRtrace>
|
||||
<sRSysVw>1</sRSysVw>
|
||||
@ -101,7 +101,7 @@
|
||||
<sRunDeb>0</sRunDeb>
|
||||
<sLrtime>0</sLrtime>
|
||||
<bEvRecOn>1</bEvRecOn>
|
||||
<nTsel>2</nTsel>
|
||||
<nTsel>5</nTsel>
|
||||
<sDll></sDll>
|
||||
<sDllPa></sDllPa>
|
||||
<sDlgDll></sDlgDll>
|
||||
@ -112,105 +112,28 @@
|
||||
<tDlgDll></tDlgDll>
|
||||
<tDlgPa></tDlgPa>
|
||||
<tIfile></tIfile>
|
||||
<pMon>BIN\CMSIS_AGDI.dll</pMon>
|
||||
<pMon>STLink\ST-LINKIII-KEIL_SWO.dll</pMon>
|
||||
</DebugOpt>
|
||||
<TargetDriverDllRegistry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGDARM</Key>
|
||||
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMRTXEVENTFLAGS</Key>
|
||||
<Name>-L70 -Z18 -C0 -M0 -T1</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGTARM</Key>
|
||||
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMDBGFLAGS</Key>
|
||||
<Name>-T0</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>CMSIS_AGDI</Key>
|
||||
<Name>-X"Any" -UAny -O206 -S8 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO65554 -TC10000000 -TP20 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F407IGHx$CMSIS\Flash\STM32F4xx_1024.FLM)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGUARM</Key>
|
||||
<Name></Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>UL2CM3</Key>
|
||||
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_1024 -FS08000000 -FL0100000 -FP0($$Device:STM32F407IGHx$CMSIS\Flash\STM32F4xx_1024.FLM))</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ST-LINKIII-KEIL_SWO</Key>
|
||||
<Name>-U16004A002933353739303541 -O2254 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P2 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8004 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC800 -FN1 -FF0STM32F4xx_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F407IGHx$CMSIS\Flash\STM32F4xx_1024.FLM)</Name>
|
||||
</SetRegEntry>
|
||||
</TargetDriverDllRegistry>
|
||||
<Breakpoint/>
|
||||
<WatchWindow1>
|
||||
<Ww>
|
||||
<count>0</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>bmi088,0x0A</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>1</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>imu_eulr,0x0A</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>2</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>imu_temp_pid_param</ItemText>
|
||||
</Ww>
|
||||
</WatchWindow1>
|
||||
<WatchWindow2>
|
||||
<Ww>
|
||||
<count>0</count>
|
||||
<WinNumber>2</WinNumber>
|
||||
<ItemText>chassis_fb,0x0A</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>1</count>
|
||||
<WinNumber>2</WinNumber>
|
||||
<ItemText>chassis_cmd,0x0A</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>2</count>
|
||||
<WinNumber>2</WinNumber>
|
||||
<ItemText>dr16,0x0A</ItemText>
|
||||
<<<<<<< HEAD
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>3</count>
|
||||
<WinNumber>2</WinNumber>
|
||||
<ItemText>chassis,0x0A</ItemText>
|
||||
=======
|
||||
>>>>>>> fc2ac5c99d3c57c83c4929b0969c6dc753eef3ac
|
||||
</Ww>
|
||||
</WatchWindow2>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
</Tracepoint>
|
||||
<DebugFlag>
|
||||
<trace>0</trace>
|
||||
<periodic>1</periodic>
|
||||
<periodic>0</periodic>
|
||||
<aLwin>0</aLwin>
|
||||
<aCover>0</aCover>
|
||||
<aSer1>0</aSer1>
|
||||
<aSer2>0</aSer2>
|
||||
<aPa>0</aPa>
|
||||
<viewmode>1</viewmode>
|
||||
<viewmode>0</viewmode>
|
||||
<vrSel>0</vrSel>
|
||||
<aSym>0</aSym>
|
||||
<aTbox>0</aTbox>
|
||||
@ -223,7 +146,7 @@
|
||||
<aPa1>0</aPa1>
|
||||
<AscS4>0</AscS4>
|
||||
<aSer4>0</aSer4>
|
||||
<StkLoc>1</StkLoc>
|
||||
<StkLoc>0</StkLoc>
|
||||
<TrcWin>0</TrcWin>
|
||||
<newCpu>0</newCpu>
|
||||
<uProt>0</uProt>
|
||||
@ -272,7 +195,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>Application/User/Core</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@ -772,7 +695,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>User/bsp</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@ -888,7 +811,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>User/device</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@ -1004,7 +927,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>User/component</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
|
||||
@ -137,7 +137,7 @@
|
||||
<DriverSelection>4101</DriverSelection>
|
||||
</Flash1>
|
||||
<bUseTDR>1</bUseTDR>
|
||||
<Flash2>BIN\UL2V8M.DLL</Flash2>
|
||||
<Flash2>BIN\UL2CM3.DLL</Flash2>
|
||||
<Flash3></Flash3>
|
||||
<Flash4></Flash4>
|
||||
<pFcarmOut></pFcarmOut>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -17,20 +17,20 @@ Library Manager: ArmAr.exe V6.7
|
||||
Hex Converter: FromElf.exe V6.7
|
||||
CPU DLL: SARMCM3.DLL V5.24.1
|
||||
Dialog DLL: DCM.DLL V1.16.0.0
|
||||
Target DLL: CMSIS_AGDI.dll V1.28.3.0
|
||||
Target DLL: STLink\ST-LINKIII-KEIL_SWO.dll V3.0.1.0
|
||||
Dialog DLL: TCM.DLL V1.32.0.0
|
||||
|
||||
<h2>Project:</h2>
|
||||
<<<<<<< HEAD
|
||||
C:\Users\ÕÅÐÞÒÕ\Desktop\chassis\MDK-ARM\zzzzh.uvprojx
|
||||
=======
|
||||
c:\Users\ÕÅÐÞÒÕ\Desktop\chassis\MDK-ARM\zzzzh.uvprojx
|
||||
>>>>>>> fc2ac5c99d3c57c83c4929b0969c6dc753eef3ac
|
||||
Project File Date: 10/19/2025
|
||||
Project File Date: 10/28/2025
|
||||
|
||||
<h2>Output:</h2>
|
||||
*** Using Compiler 'V6.7', folder: 'D:\keil\ARM\ARMCLANG\Bin'
|
||||
Build target 'zzzzh'
|
||||
compiling test.c...
|
||||
linking...
|
||||
Program Size: Code=37444 RO-data=688 RW-data=156 ZI-data=24380
|
||||
FromELF: creating hex file...
|
||||
"zzzzh\zzzzh.axf" - 0 Error(s), 0 Warning(s).
|
||||
|
||||
<h2>Software Packages used:</h2>
|
||||
@ -54,7 +54,7 @@ Package Vendor: Keil
|
||||
<h2>Collection of Component Files used:</h2>
|
||||
|
||||
* Component: ARM::CMSIS:CORE:5.0.1
|
||||
Build Time Elapsed: 00:00:05
|
||||
Build Time Elapsed: 00:00:02
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -131,9 +131,9 @@ I (..\Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim_ex.h)(0x68C65E52)
|
||||
I (..\Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_uart.h)(0x68C65E52)
|
||||
I (..\Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS_V2\cmsis_os.h)(0x68C65D59)
|
||||
I (..\Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS_V2\cmsis_os2.h)(0x68C65D59)
|
||||
I (..\User\task\user_task.h)(0x68ECF321)
|
||||
I (..\User\task\user_task.h)(0x6900CBEC)
|
||||
I (..\User\module\config.h)(0x68DCDCE8)
|
||||
I (..\User\module\chassis.h)(0x68F49369)
|
||||
I (..\User\module\chassis.h)(0x6900CBEC)
|
||||
I (..\User\bsp\can.h)(0x68EE5C62)
|
||||
I (..\Core\Inc\can.h)(0x68EE5A24)
|
||||
I (..\User\bsp\bsp.h)(0x68EE5C62)
|
||||
@ -1963,10 +1963,10 @@ I (D:\keil\ARM\ARMCLANG\include\stdbool.h)(0x588CAFD2)
|
||||
I (D:\keil\ARM\ARMCLANG\include\stdint.h)(0x588CAFD2)
|
||||
I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x588CAFD2)
|
||||
I (D:\keil\ARM\ARMCLANG\include\string.h)(0x588CAFD2)
|
||||
F (..\User\module\config.c)(0x68F78F25)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -c
-fno-rtti -funsigned-char -fshort-enums -fshort-wchar
-D__MICROLIB -gdwarf-3 -O3 -ffunction-sections -Wno-packed -Wno-missing-variable-declarations -Wno-missing-prototypes -Wno-missing-noreturn -Wno-sign-conversion -Wno-nonportable-include-path -Wno-reserved-id-macro -Wno-unused-macros -Wno-documentation-unknown-command -Wno-documentation -Wno-license-management -Wno-parentheses-equality -I ../Core/Inc -I ../Drivers/STM32F4xx_HAL_Driver/Inc -I ../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I ../Middlewares/Third_Party/FreeRTOS/Source/include -I ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 -I ../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F -I ../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I ../Drivers/CMSIS/Include -I ../User
-I./RTE/_zzzzh
-ID:/keil/ARM/PACK/ARM/CMSIS/5.0.1/CMSIS/Include
-ID:/keil/ARM/PACK/Keil/STM32F4xx_DFP/2.14.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include
-D__UVISION_VERSION="524" -D_RTE_ -DSTM32F407xx -DUSE_HAL_DRIVER -DSTM32F407xx
-o zzzzh/config.o -MD)
|
||||
F (..\User\module\config.c)(0x6900C8BE)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -c
-fno-rtti -funsigned-char -fshort-enums -fshort-wchar
-D__MICROLIB -gdwarf-3 -O3 -ffunction-sections -Wno-packed -Wno-missing-variable-declarations -Wno-missing-prototypes -Wno-missing-noreturn -Wno-sign-conversion -Wno-nonportable-include-path -Wno-reserved-id-macro -Wno-unused-macros -Wno-documentation-unknown-command -Wno-documentation -Wno-license-management -Wno-parentheses-equality -I ../Core/Inc -I ../Drivers/STM32F4xx_HAL_Driver/Inc -I ../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I ../Middlewares/Third_Party/FreeRTOS/Source/include -I ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 -I ../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F -I ../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I ../Drivers/CMSIS/Include -I ../User
-I./RTE/_zzzzh
-ID:/keil/ARM/PACK/ARM/CMSIS/5.0.1/CMSIS/Include
-ID:/keil/ARM/PACK/Keil/STM32F4xx_DFP/2.14.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include
-D__UVISION_VERSION="524" -D_RTE_ -DSTM32F407xx -DUSE_HAL_DRIVER -DSTM32F407xx
-o zzzzh/config.o -MD)
|
||||
I (..\User\module\config.h)(0x68DCDCE8)
|
||||
I (D:\keil\ARM\ARMCLANG\include\stdint.h)(0x588CAFD2)
|
||||
I (..\User\module\chassis.h)(0x68F49369)
|
||||
I (..\User\module\chassis.h)(0x6900CBEC)
|
||||
I (..\Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS_V2\cmsis_os2.h)(0x68C65D59)
|
||||
I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x588CAFD2)
|
||||
I (..\User\bsp\can.h)(0x68EE5C62)
|
||||
@ -2025,11 +2025,7 @@ I (..\User\component\ahrs.h)(0x68EE5C62)
|
||||
I (..\User\device\motor_rm.h)(0x68EE5C18)
|
||||
I (..\User\device\motor.h)(0x68EE5C18)
|
||||
I (..\User\device\device.h)(0x68EE5C63)
|
||||
<<<<<<< HEAD
|
||||
F (..\User\module\chassis.c)(0x68F647A9)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -c
-fno-rtti -funsigned-char -fshort-enums -fshort-wchar
-D__MICROLIB -gdwarf-3 -O3 -ffunction-sections -Wno-packed -Wno-missing-variable-declarations -Wno-missing-prototypes -Wno-missing-noreturn -Wno-sign-conversion -Wno-nonportable-include-path -Wno-reserved-id-macro -Wno-unused-macros -Wno-documentation-unknown-command -Wno-documentation -Wno-license-management -Wno-parentheses-equality -I ../Core/Inc -I ../Drivers/STM32F4xx_HAL_Driver/Inc -I ../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I ../Middlewares/Third_Party/FreeRTOS/Source/include -I ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 -I ../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F -I ../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I ../Drivers/CMSIS/Include -I ../User
-I./RTE/_zzzzh
-ID:/keil/ARM/PACK/ARM/CMSIS/5.0.1/CMSIS/Include
-ID:/keil/ARM/PACK/Keil/STM32F4xx_DFP/2.14.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include
-D__UVISION_VERSION="524" -D_RTE_ -DSTM32F407xx -DUSE_HAL_DRIVER -DSTM32F407xx
-o zzzzh/chassis.o -MD)
|
||||
=======
|
||||
F (..\User\module\chassis.c)(0x68F4A0FB)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -c
-fno-rtti -funsigned-char -fshort-enums -fshort-wchar
-D__MICROLIB -gdwarf-3 -O3 -ffunction-sections -Wno-packed -Wno-missing-variable-declarations -Wno-missing-prototypes -Wno-missing-noreturn -Wno-sign-conversion -Wno-nonportable-include-path -Wno-reserved-id-macro -Wno-unused-macros -Wno-documentation-unknown-command -Wno-documentation -Wno-license-management -Wno-parentheses-equality -I ../Core/Inc -I ../Drivers/STM32F4xx_HAL_Driver/Inc -I ../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I ../Middlewares/Third_Party/FreeRTOS/Source/include -I ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 -I ../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F -I ../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I ../Drivers/CMSIS/Include -I ../User
-I./RTE/_zzzzh
-ID:/keil/ARM/PACK/ARM/CMSIS/5.0.1/CMSIS/Include
-ID:/keil/ARM/PACK/Keil/STM32F4xx_DFP/2.14.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include
-D__UVISION_VERSION="524" -D_RTE_ -DSTM32F407xx -DUSE_HAL_DRIVER -DSTM32F407xx
-o zzzzh/chassis.o -MD)
|
||||
>>>>>>> fc2ac5c99d3c57c83c4929b0969c6dc753eef3ac
|
||||
F (..\User\module\chassis.c)(0x6900CBEC)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -c
-fno-rtti -funsigned-char -fshort-enums -fshort-wchar
-D__MICROLIB -gdwarf-3 -O3 -ffunction-sections -Wno-packed -Wno-missing-variable-declarations -Wno-missing-prototypes -Wno-missing-noreturn -Wno-sign-conversion -Wno-nonportable-include-path -Wno-reserved-id-macro -Wno-unused-macros -Wno-documentation-unknown-command -Wno-documentation -Wno-license-management -Wno-parentheses-equality -I ../Core/Inc -I ../Drivers/STM32F4xx_HAL_Driver/Inc -I ../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I ../Middlewares/Third_Party/FreeRTOS/Source/include -I ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 -I ../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F -I ../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I ../Drivers/CMSIS/Include -I ../User
-I./RTE/_zzzzh
-ID:/keil/ARM/PACK/ARM/CMSIS/5.0.1/CMSIS/Include
-ID:/keil/ARM/PACK/Keil/STM32F4xx_DFP/2.14.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include
-D__UVISION_VERSION="524" -D_RTE_ -DSTM32F407xx -DUSE_HAL_DRIVER -DSTM32F407xx
-o zzzzh/chassis.o -MD)
|
||||
I (..\Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS_V2\cmsis_os2.h)(0x68C65D59)
|
||||
I (D:\keil\ARM\ARMCLANG\include\stdint.h)(0x588CAFD2)
|
||||
I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x588CAFD2)
|
||||
@ -2087,12 +2083,12 @@ I (D:\keil\ARM\ARMCLANG\include\math.h)(0x58A47FFE)
|
||||
I (..\User\device\motor_rm.h)(0x68EE5C18)
|
||||
I (..\User\device\motor.h)(0x68EE5C18)
|
||||
I (..\User\device\device.h)(0x68EE5C63)
|
||||
I (..\User\module\chassis.h)(0x68F49369)
|
||||
I (..\User\module\chassis.h)(0x6900CBEC)
|
||||
I (..\User\component\filter.h)(0x68EE5C62)
|
||||
I (..\User\component\mixer.h)(0x68EE5C62)
|
||||
I (..\User\component\pid.h)(0x68EE5C62)
|
||||
F (..\User\task\init.c)(0x68ECF2BD)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -c
-fno-rtti -funsigned-char -fshort-enums -fshort-wchar
-D__MICROLIB -gdwarf-3 -O3 -ffunction-sections -Wno-packed -Wno-missing-variable-declarations -Wno-missing-prototypes -Wno-missing-noreturn -Wno-sign-conversion -Wno-nonportable-include-path -Wno-reserved-id-macro -Wno-unused-macros -Wno-documentation-unknown-command -Wno-documentation -Wno-license-management -Wno-parentheses-equality -I ../Core/Inc -I ../Drivers/STM32F4xx_HAL_Driver/Inc -I ../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I ../Middlewares/Third_Party/FreeRTOS/Source/include -I ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 -I ../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F -I ../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I ../Drivers/CMSIS/Include -I ../User
-I./RTE/_zzzzh
-ID:/keil/ARM/PACK/ARM/CMSIS/5.0.1/CMSIS/Include
-ID:/keil/ARM/PACK/Keil/STM32F4xx_DFP/2.14.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include
-D__UVISION_VERSION="524" -D_RTE_ -DSTM32F407xx -DUSE_HAL_DRIVER -DSTM32F407xx
-o zzzzh/init.o -MD)
|
||||
I (..\User\task\user_task.h)(0x68ECF321)
|
||||
F (..\User\task\init.c)(0x6900CC60)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -c
-fno-rtti -funsigned-char -fshort-enums -fshort-wchar
-D__MICROLIB -gdwarf-3 -O3 -ffunction-sections -Wno-packed -Wno-missing-variable-declarations -Wno-missing-prototypes -Wno-missing-noreturn -Wno-sign-conversion -Wno-nonportable-include-path -Wno-reserved-id-macro -Wno-unused-macros -Wno-documentation-unknown-command -Wno-documentation -Wno-license-management -Wno-parentheses-equality -I ../Core/Inc -I ../Drivers/STM32F4xx_HAL_Driver/Inc -I ../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I ../Middlewares/Third_Party/FreeRTOS/Source/include -I ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 -I ../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F -I ../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I ../Drivers/CMSIS/Include -I ../User
-I./RTE/_zzzzh
-ID:/keil/ARM/PACK/ARM/CMSIS/5.0.1/CMSIS/Include
-ID:/keil/ARM/PACK/Keil/STM32F4xx_DFP/2.14.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include
-D__UVISION_VERSION="524" -D_RTE_ -DSTM32F407xx -DUSE_HAL_DRIVER -DSTM32F407xx
-o zzzzh/init.o -MD)
|
||||
I (..\User\task\user_task.h)(0x6900CBEC)
|
||||
I (..\Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS_V2\cmsis_os2.h)(0x68C65D59)
|
||||
I (D:\keil\ARM\ARMCLANG\include\stdint.h)(0x588CAFD2)
|
||||
I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x588CAFD2)
|
||||
@ -2106,7 +2102,7 @@ I (..\Middlewares\Third_Party\FreeRTOS\Source\include\mpu_wrappers.h)(0x68C65D59
|
||||
I (..\Middlewares\Third_Party\FreeRTOS\Source\include\task.h)(0x68C65D59)
|
||||
I (..\Middlewares\Third_Party\FreeRTOS\Source\include\list.h)(0x68C65D59)
|
||||
I (..\User\module\config.h)(0x68DCDCE8)
|
||||
I (..\User\module\chassis.h)(0x68F49369)
|
||||
I (..\User\module\chassis.h)(0x6900CBEC)
|
||||
I (..\User\bsp\can.h)(0x68EE5C62)
|
||||
I (..\Core\Inc\can.h)(0x68EE5A24)
|
||||
I (..\Core\Inc\main.h)(0x68EE5A28)
|
||||
@ -2156,7 +2152,7 @@ I (..\User\device\motor.h)(0x68EE5C18)
|
||||
I (..\User\device\device.h)(0x68EE5C63)
|
||||
I (..\User\device\dr16.h)(0x68EE5C18)
|
||||
F (..\User\task\user_task.c)(0x68DE4024)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -c
-fno-rtti -funsigned-char -fshort-enums -fshort-wchar
-D__MICROLIB -gdwarf-3 -O3 -ffunction-sections -Wno-packed -Wno-missing-variable-declarations -Wno-missing-prototypes -Wno-missing-noreturn -Wno-sign-conversion -Wno-nonportable-include-path -Wno-reserved-id-macro -Wno-unused-macros -Wno-documentation-unknown-command -Wno-documentation -Wno-license-management -Wno-parentheses-equality -I ../Core/Inc -I ../Drivers/STM32F4xx_HAL_Driver/Inc -I ../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I ../Middlewares/Third_Party/FreeRTOS/Source/include -I ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 -I ../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F -I ../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I ../Drivers/CMSIS/Include -I ../User
-I./RTE/_zzzzh
-ID:/keil/ARM/PACK/ARM/CMSIS/5.0.1/CMSIS/Include
-ID:/keil/ARM/PACK/Keil/STM32F4xx_DFP/2.14.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include
-D__UVISION_VERSION="524" -D_RTE_ -DSTM32F407xx -DUSE_HAL_DRIVER -DSTM32F407xx
-o zzzzh/user_task.o -MD)
|
||||
I (..\User\task\user_task.h)(0x68ECF321)
|
||||
I (..\User\task\user_task.h)(0x6900CBEC)
|
||||
I (..\Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS_V2\cmsis_os2.h)(0x68C65D59)
|
||||
I (D:\keil\ARM\ARMCLANG\include\stdint.h)(0x588CAFD2)
|
||||
I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x588CAFD2)
|
||||
@ -2170,7 +2166,7 @@ I (..\Middlewares\Third_Party\FreeRTOS\Source\include\mpu_wrappers.h)(0x68C65D59
|
||||
I (..\Middlewares\Third_Party\FreeRTOS\Source\include\task.h)(0x68C65D59)
|
||||
I (..\Middlewares\Third_Party\FreeRTOS\Source\include\list.h)(0x68C65D59)
|
||||
I (..\User\module\config.h)(0x68DCDCE8)
|
||||
I (..\User\module\chassis.h)(0x68F49369)
|
||||
I (..\User\module\chassis.h)(0x6900CBEC)
|
||||
I (..\User\bsp\can.h)(0x68EE5C62)
|
||||
I (..\Core\Inc\can.h)(0x68EE5A24)
|
||||
I (..\Core\Inc\main.h)(0x68EE5A28)
|
||||
@ -2218,8 +2214,8 @@ I (..\User\component\ahrs.h)(0x68EE5C62)
|
||||
I (..\User\device\motor_rm.h)(0x68EE5C18)
|
||||
I (..\User\device\motor.h)(0x68EE5C18)
|
||||
I (..\User\device\device.h)(0x68EE5C63)
|
||||
F (..\User\task\test.c)(0x68F4E778)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -c
-fno-rtti -funsigned-char -fshort-enums -fshort-wchar
-D__MICROLIB -gdwarf-3 -O3 -ffunction-sections -Wno-packed -Wno-missing-variable-declarations -Wno-missing-prototypes -Wno-missing-noreturn -Wno-sign-conversion -Wno-nonportable-include-path -Wno-reserved-id-macro -Wno-unused-macros -Wno-documentation-unknown-command -Wno-documentation -Wno-license-management -Wno-parentheses-equality -I ../Core/Inc -I ../Drivers/STM32F4xx_HAL_Driver/Inc -I ../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I ../Middlewares/Third_Party/FreeRTOS/Source/include -I ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 -I ../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F -I ../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I ../Drivers/CMSIS/Include -I ../User
-I./RTE/_zzzzh
-ID:/keil/ARM/PACK/ARM/CMSIS/5.0.1/CMSIS/Include
-ID:/keil/ARM/PACK/Keil/STM32F4xx_DFP/2.14.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include
-D__UVISION_VERSION="524" -D_RTE_ -DSTM32F407xx -DUSE_HAL_DRIVER -DSTM32F407xx
-o zzzzh/test.o -MD)
|
||||
I (..\User\task\user_task.h)(0x68ECF321)
|
||||
F (..\User\task\test.c)(0x6900CC8C)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -c
-fno-rtti -funsigned-char -fshort-enums -fshort-wchar
-D__MICROLIB -gdwarf-3 -O3 -ffunction-sections -Wno-packed -Wno-missing-variable-declarations -Wno-missing-prototypes -Wno-missing-noreturn -Wno-sign-conversion -Wno-nonportable-include-path -Wno-reserved-id-macro -Wno-unused-macros -Wno-documentation-unknown-command -Wno-documentation -Wno-license-management -Wno-parentheses-equality -I ../Core/Inc -I ../Drivers/STM32F4xx_HAL_Driver/Inc -I ../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I ../Middlewares/Third_Party/FreeRTOS/Source/include -I ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 -I ../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F -I ../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I ../Drivers/CMSIS/Include -I ../User
-I./RTE/_zzzzh
-ID:/keil/ARM/PACK/ARM/CMSIS/5.0.1/CMSIS/Include
-ID:/keil/ARM/PACK/Keil/STM32F4xx_DFP/2.14.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include
-D__UVISION_VERSION="524" -D_RTE_ -DSTM32F407xx -DUSE_HAL_DRIVER -DSTM32F407xx
-o zzzzh/test.o -MD)
|
||||
I (..\User\task\user_task.h)(0x6900CBEC)
|
||||
I (..\Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS_V2\cmsis_os2.h)(0x68C65D59)
|
||||
I (D:\keil\ARM\ARMCLANG\include\stdint.h)(0x588CAFD2)
|
||||
I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x588CAFD2)
|
||||
@ -2233,7 +2229,7 @@ I (..\Middlewares\Third_Party\FreeRTOS\Source\include\mpu_wrappers.h)(0x68C65D59
|
||||
I (..\Middlewares\Third_Party\FreeRTOS\Source\include\task.h)(0x68C65D59)
|
||||
I (..\Middlewares\Third_Party\FreeRTOS\Source\include\list.h)(0x68C65D59)
|
||||
I (..\User\module\config.h)(0x68DCDCE8)
|
||||
I (..\User\module\chassis.h)(0x68F49369)
|
||||
I (..\User\module\chassis.h)(0x6900CBEC)
|
||||
I (..\User\bsp\can.h)(0x68EE5C62)
|
||||
I (..\Core\Inc\can.h)(0x68EE5A24)
|
||||
I (..\Core\Inc\main.h)(0x68EE5A28)
|
||||
@ -2282,8 +2278,8 @@ I (..\User\device\motor_rm.h)(0x68EE5C18)
|
||||
I (..\User\device\motor.h)(0x68EE5C18)
|
||||
I (..\User\device\device.h)(0x68EE5C63)
|
||||
I (..\User\device\dr16.h)(0x68EE5C18)
|
||||
F (..\User\task\yaokongqi.c)(0x68E799EC)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -c
-fno-rtti -funsigned-char -fshort-enums -fshort-wchar
-D__MICROLIB -gdwarf-3 -O3 -ffunction-sections -Wno-packed -Wno-missing-variable-declarations -Wno-missing-prototypes -Wno-missing-noreturn -Wno-sign-conversion -Wno-nonportable-include-path -Wno-reserved-id-macro -Wno-unused-macros -Wno-documentation-unknown-command -Wno-documentation -Wno-license-management -Wno-parentheses-equality -I ../Core/Inc -I ../Drivers/STM32F4xx_HAL_Driver/Inc -I ../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I ../Middlewares/Third_Party/FreeRTOS/Source/include -I ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 -I ../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F -I ../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I ../Drivers/CMSIS/Include -I ../User
-I./RTE/_zzzzh
-ID:/keil/ARM/PACK/ARM/CMSIS/5.0.1/CMSIS/Include
-ID:/keil/ARM/PACK/Keil/STM32F4xx_DFP/2.14.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include
-D__UVISION_VERSION="524" -D_RTE_ -DSTM32F407xx -DUSE_HAL_DRIVER -DSTM32F407xx
-o zzzzh/yaokongqi.o -MD)
|
||||
I (..\User\task\user_task.h)(0x68ECF321)
|
||||
F (..\User\task\yaokongqi.c)(0x6900CC60)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -c
-fno-rtti -funsigned-char -fshort-enums -fshort-wchar
-D__MICROLIB -gdwarf-3 -O3 -ffunction-sections -Wno-packed -Wno-missing-variable-declarations -Wno-missing-prototypes -Wno-missing-noreturn -Wno-sign-conversion -Wno-nonportable-include-path -Wno-reserved-id-macro -Wno-unused-macros -Wno-documentation-unknown-command -Wno-documentation -Wno-license-management -Wno-parentheses-equality -I ../Core/Inc -I ../Drivers/STM32F4xx_HAL_Driver/Inc -I ../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I ../Middlewares/Third_Party/FreeRTOS/Source/include -I ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 -I ../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F -I ../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I ../Drivers/CMSIS/Include -I ../User
-I./RTE/_zzzzh
-ID:/keil/ARM/PACK/ARM/CMSIS/5.0.1/CMSIS/Include
-ID:/keil/ARM/PACK/Keil/STM32F4xx_DFP/2.14.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include
-D__UVISION_VERSION="524" -D_RTE_ -DSTM32F407xx -DUSE_HAL_DRIVER -DSTM32F407xx
-o zzzzh/yaokongqi.o -MD)
|
||||
I (..\User\task\user_task.h)(0x6900CBEC)
|
||||
I (..\Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS_V2\cmsis_os2.h)(0x68C65D59)
|
||||
I (D:\keil\ARM\ARMCLANG\include\stdint.h)(0x588CAFD2)
|
||||
I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x588CAFD2)
|
||||
@ -2297,7 +2293,7 @@ I (..\Middlewares\Third_Party\FreeRTOS\Source\include\mpu_wrappers.h)(0x68C65D59
|
||||
I (..\Middlewares\Third_Party\FreeRTOS\Source\include\task.h)(0x68C65D59)
|
||||
I (..\Middlewares\Third_Party\FreeRTOS\Source\include\list.h)(0x68C65D59)
|
||||
I (..\User\module\config.h)(0x68DCDCE8)
|
||||
I (..\User\module\chassis.h)(0x68F49369)
|
||||
I (..\User\module\chassis.h)(0x6900CBEC)
|
||||
I (..\User\bsp\can.h)(0x68EE5C62)
|
||||
I (..\Core\Inc\can.h)(0x68EE5A24)
|
||||
I (..\Core\Inc\main.h)(0x68EE5A28)
|
||||
|
||||
@ -2,6 +2,10 @@
|
||||
µ×ÅÌÄ£×é
|
||||
*/
|
||||
|
||||
/*
|
||||
底盘模组
|
||||
*/
|
||||
|
||||
#include "cmsis_os2.h"
|
||||
#include <stdlib.h>
|
||||
#include "bsp/mm.h"
|
||||
@ -11,24 +15,34 @@
|
||||
#include "device/motor.h"
|
||||
#include "module/chassis.h"
|
||||
|
||||
|
||||
#define CHASSIS_ROTOR_WZ_MIN 0.6f
|
||||
#define CHASSIS_ROTOR_WZ_MAX 0.8f
|
||||
#define M_7OVER72PI (M_2PI * 7.0f / 72.0f)
|
||||
#define CHASSIS_ROTOR_OMEGA 0.001f
|
||||
/**
|
||||
* @brief 底盘小陀螺模式相关参数
|
||||
*/
|
||||
#define CHASSIS_ROTOR_WZ_MIN 0.6f //小陀螺最小速度
|
||||
#define CHASSIS_ROTOR_WZ_MAX 0.8f //小陀螺最大速度
|
||||
#define M_7OVER72PI (M_2PI * 7.0f / 72.0f) //角度偏移量(用在跟随云台35°)
|
||||
#define CHASSIS_ROTOR_OMEGA 0.001f //角速度变化频率
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief 设置底盘模式
|
||||
* @param c 底盘结构体指针
|
||||
* @param mode 目标控制模式
|
||||
* @param now 当前时间戳(ms)
|
||||
* @return CHASSIS_OK:成功 CHASSIS_ERR_NULL:空
|
||||
*/
|
||||
static int8_t Chassis_SetMode(Chassis_t *c, Chassis_Mode_t mode, uint32_t now) {
|
||||
if (!c)
|
||||
return CHASSIS_ERR_NULL;
|
||||
if (mode == c->mode)
|
||||
return CHASSIS_OK;
|
||||
|
||||
//随机种子,小陀螺模式随机设置旋转方向
|
||||
if (mode == CHASSIS_MODE_ROTOR && c->mode != CHASSIS_MODE_ROTOR) {
|
||||
srand(now);
|
||||
c->wz_multi = (rand() % 2) ? -1 : 1;
|
||||
}
|
||||
|
||||
//重置PID和滤波
|
||||
for (uint8_t i = 0; i < c->num_wheel; i++) {
|
||||
PID_Reset(&c->pid.motor[i]);
|
||||
LowPassFilter2p_Reset(&c->filter.in[i], 0.0f);
|
||||
@ -39,39 +53,38 @@ static int8_t Chassis_SetMode(Chassis_t *c, Chassis_Mode_t mode, uint32_t now) {
|
||||
return CHASSIS_OK;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief 小陀螺模式动态角速度
|
||||
* @param min 最小速度
|
||||
* @param max 最大速度
|
||||
* @param now 当前时间戳(ms)
|
||||
* @return 角速度值
|
||||
*/
|
||||
static float Chassis_CalcWz(const float min, const float max, uint32_t now) {
|
||||
float wz_vary = fabsf(0.2f * sinf(CHASSIS_ROTOR_OMEGA * (float)now)) + min;
|
||||
return (wz_vary > max) ? max : wz_vary;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief 底盘模式初始化
|
||||
* @param c 底盘结构体指针
|
||||
* @param param 底盘参数结构体指针
|
||||
* @param mech_zero 机械零点欧拉角
|
||||
* @param target_freq 控制频率(Hz)
|
||||
* @return CHASSIS_OK:成功 CHASSIS_ERR_NULL:空 CHASSIS_ERR_TYPE:不支持的模式
|
||||
*/
|
||||
int8_t Chassis_Init(Chassis_t *c, const Chassis_Params_t *param,
|
||||
AHRS_Eulr_t *mech_zero, float target_freq) {
|
||||
float target_freq) {
|
||||
if (!c) return CHASSIS_ERR_NULL;
|
||||
<<<<<<< HEAD
|
||||
|
||||
//初始化CAN通信
|
||||
BSP_CAN_Init();
|
||||
=======
|
||||
>>>>>>> fc2ac5c99d3c57c83c4929b0969c6dc753eef3ac
|
||||
c->param = param;
|
||||
c->mode = CHASSIS_MODE_RELAX;
|
||||
c->mech_zero = *mech_zero;
|
||||
c->feedback.imu.eulr = *mech_zero;
|
||||
|
||||
if (param->reverse.yaw) {
|
||||
CircleReverse(&(c->mech_zero.yaw));
|
||||
c->feedback.imu.eulr.yaw = -c->feedback.imu.eulr.yaw + M_2PI;
|
||||
}
|
||||
c->limit.vx.max = param->limit.max_vx;
|
||||
c->limit.vx.min = -param->limit.max_vx;
|
||||
c->limit.vy.max = param->limit.max_vy;
|
||||
c->limit.vy.min = -param->limit.max_vy;
|
||||
c->limit.wz.max = param->limit.max_wz;
|
||||
c->limit.wz.min = -param->limit.max_wz;
|
||||
|
||||
//根据底盘不同设置模式轮子与混合器
|
||||
Mixer_Mode_t mixer_mode;
|
||||
switch (param->type) {
|
||||
case CHASSIS_TYPE_MECANUM:
|
||||
case CHASSIS_TYPE_MECANUM://麦轮
|
||||
c->num_wheel = 4;
|
||||
mixer_mode = MIXER_MECANUM;
|
||||
break;
|
||||
@ -87,7 +100,7 @@ if (param->reverse.yaw) {
|
||||
c->num_wheel = 4;
|
||||
mixer_mode = MIXER_OMNICROSS;
|
||||
break;
|
||||
case CHASSIS_TYPE_OMNI_PLUS:
|
||||
case CHASSIS_TYPE_OMNI_PLUS: //全向轮(老步兵类型)
|
||||
c->num_wheel = 4;
|
||||
mixer_mode = MIXER_OMNIPLUS;
|
||||
break;
|
||||
@ -98,26 +111,29 @@ if (param->reverse.yaw) {
|
||||
default:
|
||||
return CHASSIS_ERR_TYPE;
|
||||
}
|
||||
//初始化时间戳
|
||||
c->last_wakeup = 0;
|
||||
c->dt = 0.0f;
|
||||
//初始化PID和滤波
|
||||
for (uint8_t i = 0; i < c->num_wheel; i++) {
|
||||
PID_Init(&c->pid.motor[i], KPID_MODE_NO_D, target_freq, ¶m->pid.motor_pid_param);
|
||||
LowPassFilter2p_Init(&c->filter.in[i], target_freq, param->low_pass_cutoff_freq.in);
|
||||
LowPassFilter2p_Init(&c->filter.out[i], target_freq, param->low_pass_cutoff_freq.out);
|
||||
|
||||
//清零电机反馈
|
||||
c->feedback.motor[i].rotor_speed = 0;
|
||||
c->feedback.motor[i].torque_current = 0;
|
||||
c->feedback.motor[i].rotor_abs_angle = 0;
|
||||
c->feedback.motor[i].temp = 0;
|
||||
}
|
||||
|
||||
//初始化PID和混合器
|
||||
PID_Init(&c->pid.follow, KPID_MODE_NO_D, target_freq, ¶m->pid.follow_pid_param);
|
||||
Mixer_Init(&c->mixer, mixer_mode);
|
||||
|
||||
//清零运动向量和输出
|
||||
c->move_vec.vx = c->move_vec.vy = c->move_vec.wz = 0.0f;
|
||||
for (uint8_t i = 0; i < c->num_wheel; i++) {
|
||||
c->out.motor[i] = 0.0f;
|
||||
}
|
||||
//注册大疆电机
|
||||
for (int i = 0; i < c->num_wheel; i++) {
|
||||
MOTOR_RM_Register(&(c->param->motor_param[i]));
|
||||
|
||||
@ -125,19 +141,18 @@ if (param->reverse.yaw) {
|
||||
return CHASSIS_OK;
|
||||
}
|
||||
|
||||
|
||||
int8_t Chassis_UpdateFeedback(Chassis_t *c, const Chassis_Feedback_t *feedback) {
|
||||
if (!c || !feedback) return CHASSIS_ERR_NULL;
|
||||
|
||||
float yaw = c->param->reverse.yaw ? -feedback->imu.eulr.yaw : feedback->imu.eulr.yaw;
|
||||
while (yaw > M_PI) yaw -= M_2PI;
|
||||
while (yaw < -M_PI) yaw += M_2PI;
|
||||
c->feedback.imu.eulr.yaw = yaw;
|
||||
/**
|
||||
* @brief 更新电机反馈(IMU+电机状态)
|
||||
* @param c 底盘结构体指针
|
||||
* @param feedback 底盘反馈指针结构体
|
||||
* @return CHASSIS_OK:成功 CHASSIS_ERR_NULL:空
|
||||
*/
|
||||
int8_t Chassis_UpdateFeedback(Chassis_t *c) {
|
||||
|
||||
|
||||
//更新所有电机反馈
|
||||
for (uint8_t i = 0; i < c->num_wheel; i++) {
|
||||
MOTOR_RM_Update(&(c->param->motor_param[i]));
|
||||
<<<<<<< HEAD
|
||||
MOTOR_RM_t *rm_motor = MOTOR_RM_GetMotor(&(c->param->motor_param[i]));
|
||||
c->motors[i] = rm_motor;
|
||||
MOTOR_RM_t *rm = c->motors[i];
|
||||
@ -147,41 +162,30 @@ int8_t Chassis_UpdateFeedback(Chassis_t *c, const Chassis_Feedback_t *feedback)
|
||||
{
|
||||
return CHASSIS_ERR_NULL;
|
||||
}
|
||||
=======
|
||||
// MOTOR_RM_t *rm_motor = c->motors[i];
|
||||
// if (rm_motor) {
|
||||
// c->feedback.motor[i] = rm_motor->feedback;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return CHASSIS_ERR_NULL;
|
||||
// }
|
||||
MOTOR_RM_t *rm_motor = MOTOR_RM_GetMotor(&(c->param->motor_param[i]));
|
||||
if (rm_motor != NULL) {
|
||||
c->feedback.motor[i] = rm_motor->feedback;
|
||||
}
|
||||
>>>>>>> fc2ac5c99d3c57c83c4929b0969c6dc753eef3ac
|
||||
}
|
||||
return CHASSIS_OK;
|
||||
}
|
||||
|
||||
|
||||
int8_t Chassis_Control(Chassis_t *c, const ChassisCmd_t *c_cmd, uint32_t now) {
|
||||
/**
|
||||
* @brief 底盘电机控制
|
||||
* @param c 底盘结构体指针
|
||||
* @param c_cmd 控制命令
|
||||
* @param now 当前时间戳(ms)
|
||||
* @return CHASSIS_OK:成功 CHASSIS_ERR_NULL:空
|
||||
*/
|
||||
int8_t Chassis_Control(Chassis_t *c, const Chassis_CMD_t *c_cmd, uint32_t now) {
|
||||
if (!c || !c_cmd) return CHASSIS_ERR_NULL;
|
||||
|
||||
//计算控制周期
|
||||
c->dt = (float)(now - c->last_wakeup) / 1000.0f;
|
||||
c->last_wakeup = now;
|
||||
|
||||
if (!isfinite(c->dt) || c->dt <= 0.0f) {
|
||||
c->dt = 0.001f;
|
||||
}
|
||||
if (c->dt < 0.0005f) c->dt = 0.0005f;
|
||||
if (c->dt > 0.050f) c->dt = 0.050f;
|
||||
|
||||
//设置模式
|
||||
Chassis_SetMode(c, c_cmd->mode, now);
|
||||
Clip(&c->move_vec.vx, c->limit.vx.min, c->limit.vx.max);
|
||||
Clip(&c->move_vec.vy, c->limit.vy.min, c->limit.vy.max);
|
||||
Clip(&c->move_vec.wz, c->limit.wz.min, c->limit.wz.max);
|
||||
//不同模式下对应解算(运动向量)
|
||||
switch (c->mode) {
|
||||
case CHASSIS_MODE_BREAK:
|
||||
c->move_vec.vx = c->move_vec.vy = 0.0f;
|
||||
@ -190,8 +194,8 @@ int8_t Chassis_Control(Chassis_t *c, const ChassisCmd_t *c_cmd, uint32_t now) {
|
||||
c->move_vec.vx = c_cmd->ctrl_vec.vx;
|
||||
c->move_vec.vy = c_cmd->ctrl_vec.vy;
|
||||
break;
|
||||
default: {
|
||||
float beta = c->feedback.imu.eulr.yaw - c->mech_zero.yaw;
|
||||
default: { //遥控器坐标->机体坐标系
|
||||
float beta = c->feedback.encoder_gimbalYawMotor - c->mech_zero;
|
||||
float cosb = cosf(beta);
|
||||
float sinb = sinf(beta);
|
||||
c->move_vec.vx = cosb * c_cmd->ctrl_vec.vx - sinb * c_cmd->ctrl_vec.vy;
|
||||
@ -199,6 +203,7 @@ int8_t Chassis_Control(Chassis_t *c, const ChassisCmd_t *c_cmd, uint32_t now) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
//根据模式计算底盘角速度
|
||||
switch (c->mode) {
|
||||
case CHASSIS_MODE_RELAX:
|
||||
case CHASSIS_MODE_BREAK:
|
||||
@ -207,33 +212,28 @@ int8_t Chassis_Control(Chassis_t *c, const ChassisCmd_t *c_cmd, uint32_t now) {
|
||||
break;
|
||||
case CHASSIS_MODE_OPEN:
|
||||
c->move_vec.wz = c_cmd->ctrl_vec.wz;
|
||||
<<<<<<< HEAD
|
||||
break;
|
||||
=======
|
||||
>>>>>>> fc2ac5c99d3c57c83c4929b0969c6dc753eef3ac
|
||||
//云台跟随
|
||||
case CHASSIS_MODE_FOLLOW_GIMBAL:
|
||||
c->move_vec.wz = PID_Calc(&c->pid.follow, c->mech_zero.yaw, c->feedback.imu.eulr.yaw, 0.0f, c->dt);
|
||||
c->move_vec.wz = PID_Calc(&c->pid.follow, c->mech_zero, c->feedback.encoder_gimbalYawMotor, 0.0f, c->dt);
|
||||
break;
|
||||
//云台跟随(偏移)
|
||||
case CHASSIS_MODE_FOLLOW_GIMBAL_35:
|
||||
c->move_vec.wz = PID_Calc(&c->pid.follow,c->mech_zero.yaw +M_7OVER72PI, c->feedback.imu.eulr.yaw, 0.0f, c->dt);
|
||||
c->move_vec.wz = PID_Calc(&c->pid.follow,c->mech_zero +M_7OVER72PI, c->feedback.encoder_gimbalYawMotor, 0.0f, c->dt);
|
||||
break;
|
||||
//小陀螺
|
||||
case CHASSIS_MODE_ROTOR:
|
||||
c->move_vec.wz = c->wz_multi * Chassis_CalcWz(CHASSIS_ROTOR_WZ_MIN,
|
||||
CHASSIS_ROTOR_WZ_MAX, now);
|
||||
c->move_vec.wz = c->wz_multi * Chassis_CalcWz(CHASSIS_ROTOR_WZ_MIN,CHASSIS_ROTOR_WZ_MAX, now);
|
||||
break;
|
||||
}
|
||||
|
||||
Mixer_Apply(&c->mixer, &c->move_vec, c->setpoint.motor_rpm, c->num_wheel, 3000.0f);
|
||||
//运动学逆解算,运动向量分解为电机转速
|
||||
Mixer_Apply(&c->mixer, &c->move_vec, c->setpoint.motor_rpm, c->num_wheel, 500.0f);
|
||||
|
||||
|
||||
for (uint8_t i = 0; i < c->num_wheel; i++) {
|
||||
float rf = c->setpoint.motor_rpm[i];
|
||||
float rf = c->setpoint.motor_rpm[i];///目标转速
|
||||
float fb = LowPassFilter2p_Apply(&c->filter.in[i], (float)c->feedback.motor[i].rotor_speed);
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
//float out_current = 0.0f;
|
||||
>>>>>>> fc2ac5c99d3c57c83c4929b0969c6dc753eef3ac
|
||||
float out_current = PID_Calc(&c->pid.motor[i], rf, fb, 0.0f, c->dt);
|
||||
float out_current;
|
||||
switch (c->mode) {
|
||||
case CHASSIS_MODE_BREAK:
|
||||
case CHASSIS_MODE_FOLLOW_GIMBAL:
|
||||
@ -243,18 +243,14 @@ int8_t Chassis_Control(Chassis_t *c, const ChassisCmd_t *c_cmd, uint32_t now) {
|
||||
out_current = PID_Calc(&c->pid.motor[i], c->setpoint.motor_rpm[i], fb, 0.0f, c->dt);
|
||||
break;
|
||||
case CHASSIS_MODE_OPEN:
|
||||
<<<<<<< HEAD
|
||||
out_current = c->setpoint.motor_rpm[i] / 3000.0f;
|
||||
=======
|
||||
out_current = c->setpoint.motor_rpm[i] / 7000.0f;
|
||||
>>>>>>> fc2ac5c99d3c57c83c4929b0969c6dc753eef3ac
|
||||
break;
|
||||
case CHASSIS_MODE_RELAX:
|
||||
out_current = 0.0f;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
//低通滤波和限幅
|
||||
c->out.motor[i] = LowPassFilter2p_Apply(&c->filter.out[i], out_current);
|
||||
Clip(&c->out.motor[i], -c->param->limit.max_current, c->param->limit.max_current);
|
||||
}
|
||||
@ -263,6 +259,10 @@ int8_t Chassis_Control(Chassis_t *c, const ChassisCmd_t *c_cmd, uint32_t now) {
|
||||
return CHASSIS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 电机输出
|
||||
* @param c 底盘结构体指针
|
||||
*/
|
||||
void Chassis_Output(Chassis_t *c) {
|
||||
if (!c)
|
||||
return;
|
||||
@ -283,7 +283,10 @@ void Chassis_Output(Chassis_t *c) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief 重置底盘输出
|
||||
* @param c 底盘结构体指针
|
||||
*/
|
||||
void Chassis_ResetOutput(Chassis_t *c) {
|
||||
if (!c) return;
|
||||
for (uint8_t i = 0; i < c->num_wheel; i++) {
|
||||
@ -294,4 +297,3 @@ void Chassis_ResetOutput(Chassis_t *c) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@ typedef struct {
|
||||
Chassis_Mode_t mode; /* 底盘运行模式 */
|
||||
Chassis_RotorMode_t mode_rotor; /* 小陀螺转动模式 */
|
||||
MoveVector_t ctrl_vec; /* 底盘控制向量 */
|
||||
} ChassisCmd_t;
|
||||
} Chassis_CMD_t;
|
||||
|
||||
/* 限位 */
|
||||
typedef struct {
|
||||
@ -98,8 +98,8 @@ typedef struct {
|
||||
} Chassis_IMU_t;
|
||||
|
||||
typedef struct {
|
||||
Chassis_IMU_t imu; // 底盘 IMU(yaw 用来跟随云台)
|
||||
MOTOR_Feedback_t motor[4]; // 四个 3508电机 反馈
|
||||
float encoder_gimbalYawMotor;
|
||||
} Chassis_Feedback_t;
|
||||
|
||||
/* 底盘输出结构体*/
|
||||
@ -126,7 +126,7 @@ typedef struct {
|
||||
Mixer_t mixer; /* 混合器,移动向量->电机目标值 */
|
||||
MoveVector_t move_vec; /* 底盘实际的运动向量 */
|
||||
MOTOR_RM_t *motors[4];/*指向底盘每个电机参数*/
|
||||
AHRS_Eulr_t mech_zero;
|
||||
float mech_zero;
|
||||
float wz_multi; /* 小陀螺旋转模式 */
|
||||
|
||||
/* PID计算目标值 */
|
||||
@ -167,7 +167,7 @@ typedef struct {
|
||||
* \return 运行结果
|
||||
*/
|
||||
int8_t Chassis_Init(Chassis_t *c, const Chassis_Params_t *param,
|
||||
AHRS_Eulr_t *mech_zero, float target_freq);
|
||||
float target_freq);
|
||||
|
||||
/**
|
||||
* \brief 更新底盘反馈信息
|
||||
@ -177,7 +177,7 @@ int8_t Chassis_Init(Chassis_t *c, const Chassis_Params_t *param,
|
||||
*
|
||||
* \return 运行结果
|
||||
*/
|
||||
int8_t Chassis_UpdateFeedback(Chassis_t *c, const Chassis_Feedback_t *feedback);
|
||||
int8_t Chassis_UpdateFeedback(Chassis_t *c);
|
||||
|
||||
/**
|
||||
* \brief 运行底盘控制逻辑
|
||||
@ -188,7 +188,7 @@ int8_t Chassis_UpdateFeedback(Chassis_t *c, const Chassis_Feedback_t *feedback);
|
||||
*
|
||||
* \return 运行结果
|
||||
*/
|
||||
int8_t Chassis_Control(Chassis_t *c, const ChassisCmd_t *c_cmd,
|
||||
int8_t Chassis_Control(Chassis_t *c, const Chassis_CMD_t *c_cmd,
|
||||
uint32_t now);
|
||||
|
||||
|
||||
|
||||
@ -37,8 +37,8 @@ void Task_Init(void *argument) {
|
||||
/* USER MESSAGE BEGIN */
|
||||
task_runtime.msgq.user_msg= osMessageQueueNew(2u, 10, NULL);
|
||||
task_runtime.msgq.dr16_data = osMessageQueueNew(2u, sizeof(DR16_t), NULL);
|
||||
task_runtime.msgq.Chassis_cmd = osMessageQueueNew(2u, sizeof(ChassisCmd_t), NULL);
|
||||
task_runtime.msgq.Chassis_imu = osMessageQueueNew(2u, sizeof(Chassis_IMU_t), NULL);
|
||||
task_runtime.msgq.chassis.cmd = osMessageQueueNew(2u, sizeof(Chassis_CMD_t), NULL);
|
||||
task_runtime.msgq.chassis.yaw = osMessageQueueNew(2u, sizeof(float), NULL);
|
||||
/* USER MESSAGE END */
|
||||
|
||||
osKernelUnlock(); // 解锁内核
|
||||
|
||||
108
User/task/test.c
108
User/task/test.c
@ -18,114 +18,44 @@
|
||||
/* Private variables -------------------------------------------------------- */
|
||||
/* USER STRUCT BEGIN */
|
||||
Chassis_t chassis;
|
||||
ChassisCmd_t chassis_cmd; // 控制命令
|
||||
Chassis_CMD_t chassis_cmd; // 控制命令
|
||||
Chassis_IMU_t chassis_imu;
|
||||
Chassis_Feedback_t chassis_fb; // 反馈的底盘状态
|
||||
static AHRS_Eulr_t mech_zero = {0}; // 机械零位(初始 yaw)
|
||||
#define DR16_CH_VALUE_MID (1024u)
|
||||
|
||||
/* USER STRUCT END */
|
||||
|
||||
/* Private function --------------------------------------------------------- */
|
||||
/* Exported functions ------------------------------------------------------- */
|
||||
//void Task_test(void *argument) {
|
||||
// (void)argument; /* 未使用argument,消除警告 */
|
||||
|
||||
//
|
||||
// /* 计算任务运行到指定频率需要等待的tick数 */
|
||||
// const uint32_t delay_tick = osKernelGetTickFreq() / TEST_FREQ;
|
||||
|
||||
// osDelay(TEST_INIT_DELAY); /* 延时一段时间再开启任务 */
|
||||
|
||||
// uint32_t tick = osKernelGetTickCount(); /* 控制任务运行频率的计时 */
|
||||
// /* USER CODE INIT BEGIN */
|
||||
// Config_RobotParam_t *cfg = Config_GetRobotParam();
|
||||
// Chassis_Init(&chassis, &Config_GetRobotParam()->chassis_param, &mech_zero, TEST_FREQ);
|
||||
//
|
||||
// bool mech_zero_locked = false; // 首次 IMU 到来后只锁一次
|
||||
|
||||
// // 默认命令:安全状态
|
||||
// chassis_cmd.mode = CHASSIS_MODE_RELAX;
|
||||
// chassis_cmd.ctrl_vec.vx = 0.0f;
|
||||
// chassis_cmd.ctrl_vec.vy = 0.0f;
|
||||
// chassis_cmd.ctrl_vec.wz = 0.0f;
|
||||
//// /* USER CODE INIT END */
|
||||
//
|
||||
// while (1) {
|
||||
// tick += delay_tick; /* 计算下一个唤醒时刻 */
|
||||
// /* USER CODE BEGIN */
|
||||
// if (osMessageQueueGet(task_runtime.msgq.Chassis_imu, &chassis_imu, NULL, 0) == osOK) {
|
||||
// chassis_fb.imu = chassis_imu;
|
||||
// chassis.feedback.imu = chassis_imu;
|
||||
// if (!mech_zero_locked) {
|
||||
// mech_zero.yaw = chassis_imu.eulr.yaw; // 只在需要“上电即定零”时保留
|
||||
// mech_zero_locked = true;
|
||||
// }
|
||||
//}
|
||||
////if(osMessageQueueGet(task_runtime.msgq.Chassis_cmd, &chassis_cmd, NULL, 0) == osOK) {
|
||||
////
|
||||
////}
|
||||
// Chassis_UpdateFeedback(&chassis, &chassis_fb);
|
||||
// // 构造底盘指令
|
||||
// chassis_cmd.mode = CHASSIS_MODE_FOLLOW_GIMBAL;
|
||||
// // 控制计算
|
||||
// Chassis_Control(&chassis, &chassis_cmd, osKernelGetTickCount());
|
||||
// // 输出电流到电机
|
||||
// Chassis_Output(&chassis);
|
||||
|
||||
//// /* USER CODE END */
|
||||
// osDelayUntil(tick); /* 运行结束,等待下一次唤醒 */
|
||||
// }
|
||||
//
|
||||
//}
|
||||
|
||||
|
||||
void Task_test(void *argument) {
|
||||
(void)argument;
|
||||
(void)argument; /* 未使用argument,消除警告 */
|
||||
|
||||
/* 以 TEST_FREQ 定频运行 */
|
||||
|
||||
/* 计算任务运行到指定频率需要等待的tick数 */
|
||||
const uint32_t delay_tick = osKernelGetTickFreq() / TEST_FREQ;
|
||||
osDelay(TEST_INIT_DELAY);
|
||||
|
||||
uint32_t tick = osKernelGetTickCount();
|
||||
osDelay(TEST_INIT_DELAY); /* 延时一段时间再开启任务 */
|
||||
|
||||
uint32_t tick = osKernelGetTickCount(); /* 控制任务运行频率的计时 */
|
||||
/* USER CODE INIT BEGIN */
|
||||
/* === 初始化底盘 === */
|
||||
Config_RobotParam_t *cfg = Config_GetRobotParam();
|
||||
Chassis_Init(&chassis, &cfg->chassis_param, &mech_zero, (float)TEST_FREQ);
|
||||
Chassis_Init(&chassis, &cfg->chassis_param, (float)TEST_FREQ);
|
||||
chassis.mech_zero=4.13f;
|
||||
|
||||
/* 默认安全命令 */
|
||||
chassis_cmd.mode = CHASSIS_MODE_RELAX;
|
||||
chassis_cmd.ctrl_vec.vx = 0.0f;
|
||||
chassis_cmd.ctrl_vec.vy = 0.0f;
|
||||
chassis_cmd.ctrl_vec.wz = 0.0f;
|
||||
|
||||
bool mech_zero_locked = false;
|
||||
/* USER CODE INIT END */
|
||||
|
||||
while (1) {
|
||||
tick += delay_tick;
|
||||
|
||||
/* 1) 非阻塞取 IMU(如果来了就更新;没来就用上一帧) */
|
||||
if (osMessageQueueGet(task_runtime.msgq.Chassis_imu, &chassis_imu, NULL, 0) == osOK) {
|
||||
chassis_fb.imu = chassis_imu;
|
||||
chassis.feedback.imu = chassis_imu; // 兼容你在其他处直接读 chassis.feedback 的用法
|
||||
|
||||
if (!mech_zero_locked) {
|
||||
mech_zero.yaw = chassis_imu.eulr.yaw; // 首帧锁零(按需保留)
|
||||
mech_zero_locked = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* 2) 免遥控:设定固定运动指令(独立模式,不跟随云台) */
|
||||
chassis_cmd.mode = CHASSIS_MODE_INDEPENDENT;
|
||||
chassis_cmd.ctrl_vec.vx = 1.0f;
|
||||
chassis_cmd.ctrl_vec.vy = 0.0f;
|
||||
chassis_cmd.ctrl_vec.wz = 0.0f;
|
||||
tick += delay_tick; /* 计算下一个唤醒时刻 */
|
||||
/* USER CODE BEGIN */
|
||||
|
||||
//osMessageQueueGet(task_runtime.msgq.chassis.yaw, &chassis.feedback.encoder_gimbalYawMotor, NULL, 0);从yaw电机反馈得到值
|
||||
//osMessageQueueGet(task_runtime.msgq.chassis.cmd, &chassis_cmd, NULL, 0);//遥控器
|
||||
/* 3) 更新反馈 → 控制 → 输出 */
|
||||
Chassis_UpdateFeedback(&chassis, &chassis_fb);
|
||||
Chassis_UpdateFeedback(&chassis);
|
||||
Chassis_Control(&chassis, &chassis_cmd, osKernelGetTickCount());
|
||||
Chassis_Output(&chassis);
|
||||
/* USER CODE END */
|
||||
osDelayUntil(tick); /* 运行结束,等待下一次唤醒 */
|
||||
}
|
||||
|
||||
osDelayUntil(tick);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -38,8 +38,11 @@ typedef struct {
|
||||
struct {
|
||||
osMessageQueueId_t user_msg; /* 用户自定义任务消息队列 */
|
||||
osMessageQueueId_t dr16_data; /* dr16遥控器数据 */
|
||||
osMessageQueueId_t Chassis_cmd;
|
||||
osMessageQueueId_t Chassis_imu;
|
||||
struct {
|
||||
osMessageQueueId_t imu;
|
||||
osMessageQueueId_t cmd;
|
||||
osMessageQueueId_t yaw;
|
||||
}chassis;
|
||||
} msgq;
|
||||
/* USER MESSAGE END */
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
/* Private variables -------------------------------------------------------- */
|
||||
/* USER STRUCT BEGIN */
|
||||
DR16_t dr16;
|
||||
ChassisCmd_t cmd_to_chassis; // 控制命令
|
||||
Chassis_CMD_t cmd_to_chassis; // 控制命令
|
||||
/* USER STRUCT END */
|
||||
|
||||
/* Private function --------------------------------------------------------- */
|
||||
@ -65,7 +65,7 @@ void Task_yaokongqi(void *argument) {
|
||||
}
|
||||
// ChassisCmd_t tmp;
|
||||
|
||||
osMessageQueuePut(task_runtime.msgq.Chassis_cmd, &cmd_to_chassis, 0, 0);
|
||||
osMessageQueuePut(task_runtime.msgq.chassis.cmd, &cmd_to_chassis, 0, 0);
|
||||
/* USER CODE END */
|
||||
osDelayUntil(tick); /* 运行结束,等待下一次唤醒 */
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user