Compare commits
9 Commits
3404c951b8
...
d79bb5ea0b
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d79bb5ea0b | ||
![]() |
3a509aaf87 | ||
![]() |
aa5e191f30 | ||
![]() |
1b0ed78b10 | ||
![]() |
fe7d4bd705 | ||
![]() |
0ff235f235 | ||
![]() |
1f897bd9ae | ||
![]() |
6b05b4d58a | ||
![]() |
a749be5f93 |
File diff suppressed because one or more lines are too long
@ -417,7 +417,20 @@
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>host</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>12</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>gimbal_ai</ItemText>
|
||||
</Ww>
|
||||
</WatchWindow1>
|
||||
<MemoryWindow4>
|
||||
<Mm>
|
||||
<WinNumber>4</WinNumber>
|
||||
<SubType>0</SubType>
|
||||
<ItemText>for_chassis</ItemText>
|
||||
<AccSizeX>0</AccSizeX>
|
||||
</Mm>
|
||||
</MemoryWindow4>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
</Tracepoint>
|
||||
|
Binary file not shown.
@ -22,7 +22,7 @@ Dialog DLL: TCM.DLL V1.48.0.0
|
||||
|
||||
<h2>Project:</h2>
|
||||
C:\Users\lvzucheng\Documents\RMUL2025\MDK-ARM\DevC.uvprojx
|
||||
Project File Date: 03/09/2025
|
||||
Project File Date: 03/19/2025
|
||||
|
||||
<h2>Output:</h2>
|
||||
*** Using Compiler 'V6.16', folder: 'C:\Keil_v5\ARM\ARMCLANG\Bin'
|
||||
@ -37,9 +37,13 @@ Note: source file '..\User\task\ai.c' - object file renamed from 'DevC\ai.o' to
|
||||
Note: source file '..\User\task\can.c' - object file renamed from 'DevC\can.o' to 'DevC\can_3.o'.
|
||||
Note: source file '..\User\task\cap.c' - object file renamed from 'DevC\cap.o' to 'DevC\cap_1.o'.
|
||||
Note: source file '..\User\task\referee.c' - object file renamed from 'DevC\referee.o' to 'DevC\referee_1.o'.
|
||||
compiling cmd.c...
|
||||
compiling user_math.c...
|
||||
compiling main.c...
|
||||
compiling ai.c...
|
||||
compiling config.c...
|
||||
compiling shoot.c...
|
||||
linking...
|
||||
Program Size: Code=149536 RO-data=7272 RW-data=760 ZI-data=43832
|
||||
Program Size: Code=149600 RO-data=6928 RW-data=1104 ZI-data=43832
|
||||
FromELF: creating hex file...
|
||||
"DevC\DevC.axf" - 0 Error(s), 0 Warning(s).
|
||||
|
||||
@ -55,7 +59,7 @@ Package Vendor: Keil
|
||||
C:\Users\lvzucheng\AppData\Local\Arm\Packs\Keil\STM32F4xx_DFP\2.15.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include
|
||||
|
||||
<h2>Collection of Component Files used:</h2>
|
||||
Build Time Elapsed: 00:00:02
|
||||
Build Time Elapsed: 00:00:03
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
19327
MDK-ARM/DevC/DevC.hex
19327
MDK-ARM/DevC/DevC.hex
File diff suppressed because it is too large
Load Diff
@ -3,7 +3,7 @@
|
||||
<title>Static Call Graph - [DevC\DevC.axf]</title></head>
|
||||
<body><HR>
|
||||
<H1>Static Call Graph for image DevC\DevC.axf</H1><HR>
|
||||
<BR><P>#<CALLGRAPH># ARM Linker, 6160001: Last Updated: Mon Mar 10 22:02:56 2025
|
||||
<BR><P>#<CALLGRAPH># ARM Linker, 6160001: Last Updated: Wed Mar 19 17:14:45 2025
|
||||
<BR><P>
|
||||
<H3>Maximum Stack Usage = 632 bytes + Unknown(Cycles, Untraceable Function Pointers)</H3><H3>
|
||||
Call chain for Maximum Stack Depth:</H3>
|
||||
@ -724,9 +724,9 @@ Global Symbols
|
||||
<BR>[Called By]<UL><LI><a href="#[347]">>></a> __ieee754_rem_pio2
|
||||
</UL>
|
||||
|
||||
<P><STRONG><a name="[362]"></a>__decompress</STRONG> (Thumb, 0 bytes, Stack size unknown bytes, __dczerorl2.o(.text), UNUSED)
|
||||
<P><STRONG><a name="[362]"></a>__decompress</STRONG> (Thumb, 0 bytes, Stack size unknown bytes, __dclz77c.o(.text), UNUSED)
|
||||
|
||||
<P><STRONG><a name="[363]"></a>__decompress1</STRONG> (Thumb, 86 bytes, Stack size unknown bytes, __dczerorl2.o(.text), UNUSED)
|
||||
<P><STRONG><a name="[363]"></a>__decompress2</STRONG> (Thumb, 94 bytes, Stack size unknown bytes, __dclz77c.o(.text), UNUSED)
|
||||
|
||||
<P><STRONG><a name="[c3]"></a>AHRS_GetEulr</STRONG> (Thumb, 348 bytes, Stack size 48 bytes, ahrs.o(.text.AHRS_GetEulr))
|
||||
<BR><BR>[Stack]<UL><LI>Max Depth = 80<LI>Call Chain = AHRS_GetEulr ⇒ __hardfp_atan2f
|
||||
@ -751,8 +751,8 @@ Global Symbols
|
||||
<P><STRONG><a name="[188]"></a>AHRS_ResetEulr</STRONG> (Thumb, 18 bytes, Stack size 4 bytes, ahrs.o(.text.AHRS_ResetEulr))
|
||||
<BR><BR>[Stack]<UL><LI>Max Depth = 4<LI>Call Chain = AHRS_ResetEulr
|
||||
</UL>
|
||||
<BR>[Called By]<UL><LI><a href="#[184]">>></a> Gimbal_SetMode
|
||||
<LI><a href="#[183]">>></a> Gimbal_Control
|
||||
<BR>[Called By]<UL><LI><a href="#[183]">>></a> Gimbal_Control
|
||||
<LI><a href="#[184]">>></a> Gimbal_SetMode
|
||||
</UL>
|
||||
|
||||
<P><STRONG><a name="[ca]"></a>AHRS_Update</STRONG> (Thumb, 3098 bytes, Stack size 224 bytes, ahrs.o(.text.AHRS_Update))
|
||||
@ -1353,7 +1353,7 @@ Global Symbols
|
||||
<BR>[Called By]<UL><LI><a href="#[268]">>></a> Referee_Parse
|
||||
</UL>
|
||||
|
||||
<P><STRONG><a name="[280]"></a>CalculateRpm</STRONG> (Thumb, 284 bytes, Stack size 20 bytes, user_math.o(.text.CalculateRpm))
|
||||
<P><STRONG><a name="[280]"></a>CalculateRpm</STRONG> (Thumb, 320 bytes, Stack size 20 bytes, user_math.o(.text.CalculateRpm))
|
||||
<BR><BR>[Stack]<UL><LI>Max Depth = 20<LI>Call Chain = CalculateRpm
|
||||
</UL>
|
||||
<BR>[Called By]<UL><LI><a href="#[27c]">>></a> Shoot_Control
|
||||
@ -1443,20 +1443,20 @@ Global Symbols
|
||||
<P><STRONG><a name="[185]"></a>CircleAdd</STRONG> (Thumb, 132 bytes, Stack size 16 bytes, user_math.o(.text.CircleAdd))
|
||||
<BR><BR>[Stack]<UL><LI>Max Depth = 16<LI>Call Chain = CircleAdd
|
||||
</UL>
|
||||
<BR>[Called By]<UL><LI><a href="#[283]">>></a> Shoot_UpdateFeedback
|
||||
<BR>[Called By]<UL><LI><a href="#[183]">>></a> Gimbal_Control
|
||||
<LI><a href="#[283]">>></a> Shoot_UpdateFeedback
|
||||
<LI><a href="#[27c]">>></a> Shoot_Control
|
||||
<LI><a href="#[27d]">>></a> Shoot_SetMode
|
||||
<LI><a href="#[189]">>></a> Gimbal_Init
|
||||
<LI><a href="#[183]">>></a> Gimbal_Control
|
||||
</UL>
|
||||
|
||||
<P><STRONG><a name="[186]"></a>CircleError</STRONG> (Thumb, 154 bytes, Stack size 20 bytes, user_math.o(.text.CircleError))
|
||||
<BR><BR>[Stack]<UL><LI>Max Depth = 20<LI>Call Chain = CircleError
|
||||
</UL>
|
||||
<BR>[Called By]<UL><LI><a href="#[148]">>></a> PID_Calc
|
||||
<BR>[Called By]<UL><LI><a href="#[183]">>></a> Gimbal_Control
|
||||
<LI><a href="#[148]">>></a> PID_Calc
|
||||
<LI><a href="#[283]">>></a> Shoot_UpdateFeedback
|
||||
<LI><a href="#[27d]">>></a> Shoot_SetMode
|
||||
<LI><a href="#[183]">>></a> Gimbal_Control
|
||||
</UL>
|
||||
|
||||
<P><STRONG><a name="[14c]"></a>CircleReverse</STRONG> (Thumb, 32 bytes, Stack size 4 bytes, user_math.o(.text.CircleReverse))
|
||||
@ -1752,7 +1752,7 @@ Global Symbols
|
||||
<BR>[Called By]<UL><LI><a href="#[8e]">>></a> Task_CLI
|
||||
</UL>
|
||||
|
||||
<P><STRONG><a name="[183]"></a>Gimbal_Control</STRONG> (Thumb, 844 bytes, Stack size 64 bytes, gimbal.o(.text.Gimbal_Control))
|
||||
<P><STRONG><a name="[183]"></a>Gimbal_Control</STRONG> (Thumb, 856 bytes, Stack size 64 bytes, gimbal.o(.text.Gimbal_Control))
|
||||
<BR><BR>[Stack]<UL><LI>Max Depth = 184<LI>Call Chain = Gimbal_Control ⇒ Gimbal_SetMode ⇒ PID_Reset ⇒ LowPassFilter2p_Reset ⇒ LowPassFilter2p_Apply ⇒ __ARM_isinf
|
||||
</UL>
|
||||
<BR>[Calls]<UL><LI><a href="#[184]">>></a> Gimbal_SetMode
|
||||
@ -3118,11 +3118,11 @@ Global Symbols
|
||||
<LI><a href="#[23a]">>></a> __ARM_isinf
|
||||
<LI><a href="#[c8]">>></a> __aeabi_f2d
|
||||
</UL>
|
||||
<BR>[Called By]<UL><LI><a href="#[145]">>></a> Chassis_Control
|
||||
<BR>[Called By]<UL><LI><a href="#[183]">>></a> Gimbal_Control
|
||||
<LI><a href="#[145]">>></a> Chassis_Control
|
||||
<LI><a href="#[148]">>></a> PID_Calc
|
||||
<LI><a href="#[156]">>></a> LowPassFilter2p_Reset
|
||||
<LI><a href="#[27c]">>></a> Shoot_Control
|
||||
<LI><a href="#[183]">>></a> Gimbal_Control
|
||||
</UL>
|
||||
|
||||
<P><STRONG><a name="[14e]"></a>LowPassFilter2p_Init</STRONG> (Thumb, 316 bytes, Stack size 40 bytes, filter.o(.text.LowPassFilter2p_Init))
|
||||
@ -3448,10 +3448,10 @@ Global Symbols
|
||||
<LI><a href="#[14a]">>></a> LowPassFilter2p_Apply
|
||||
<LI><a href="#[c8]">>></a> __aeabi_f2d
|
||||
</UL>
|
||||
<BR>[Called By]<UL><LI><a href="#[145]">>></a> Chassis_Control
|
||||
<BR>[Called By]<UL><LI><a href="#[183]">>></a> Gimbal_Control
|
||||
<LI><a href="#[145]">>></a> Chassis_Control
|
||||
<LI><a href="#[8d]">>></a> Task_AttiEsti
|
||||
<LI><a href="#[27c]">>></a> Shoot_Control
|
||||
<LI><a href="#[183]">>></a> Gimbal_Control
|
||||
</UL>
|
||||
|
||||
<P><STRONG><a name="[14d]"></a>PID_Init</STRONG> (Thumb, 406 bytes, Stack size 32 bytes, pid.o(.text.PID_Init))
|
||||
@ -3972,12 +3972,12 @@ Global Symbols
|
||||
<LI><a href="#[f7]">>></a> osKernelGetTickFreq
|
||||
<LI><a href="#[289]">>></a> osKernelGetTickCount
|
||||
<LI><a href="#[28e]">>></a> osDelayUntil
|
||||
<LI><a href="#[183]">>></a> Gimbal_Control
|
||||
<LI><a href="#[18a]">>></a> Gimbal_UpdateFeedback
|
||||
<LI><a href="#[29e]">>></a> Gimbal_PackAI
|
||||
<LI><a href="#[189]">>></a> Gimbal_Init
|
||||
<LI><a href="#[2a0]">>></a> Gimbal_DumpUI
|
||||
<LI><a href="#[29f]">>></a> Gimbal_DumpOutput
|
||||
<LI><a href="#[183]">>></a> Gimbal_Control
|
||||
</UL>
|
||||
<BR>[Address Reference Count : 1]<UL><LI> init.o(.text.Task_Init)
|
||||
</UL>
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -107,6 +107,7 @@ inline float CalculateRpm(float bullet_speed, float fric_radius, bool is17mm) {
|
||||
if (is17mm) {
|
||||
if (bullet_speed == 15.0f) return 4670.f;
|
||||
if (bullet_speed == 18.0f) return 5200.f;
|
||||
if (bullet_speed == 25.0f) return 6600.f;
|
||||
if (bullet_speed == 30.0f) return 7350.f;
|
||||
} else {
|
||||
if (bullet_speed == 10.0f) return 4450.f;
|
||||
|
@ -51,7 +51,7 @@ int8_t AI_Init(AI_t *ai) {
|
||||
BSP_UART_RegisterCallback(BSP_UART_AI, BSP_UART_IDLE_LINE_CB,
|
||||
Ai_IdleLineCallback);
|
||||
|
||||
ai->search_velocity.yaw = 0.0015f;
|
||||
ai->search_velocity.yaw = 0.0025f;
|
||||
ai->search_velocity.pit = 0.003f;
|
||||
inited = true;
|
||||
return 0;
|
||||
@ -99,15 +99,15 @@ void AI_PackCmd(AI_t *ai, CMD_Host_t *cmd_host) {
|
||||
}
|
||||
|
||||
void AI_SearchArmor(AI_t *ai, CMD_Host_t *cmd_host , AHRS_Eulr_t *gimbal_ai){
|
||||
if (gimbal_ai->pit > 2.75){
|
||||
if (gimbal_ai->pit > 2.45){
|
||||
ai->search_velocity.pit = fAbs(ai->search_velocity.pit);
|
||||
} else if (gimbal_ai->pit < 2.35) {
|
||||
} else if (gimbal_ai->pit < 2.2) {
|
||||
ai->search_velocity.pit = -fAbs(ai->search_velocity.pit);
|
||||
}
|
||||
|
||||
if (gimbal_ai->yaw > 1.4 && gimbal_ai->yaw < 1.7) {
|
||||
if (gimbal_ai->yaw > 1.5 && gimbal_ai->yaw < 1.9) {
|
||||
ai->search_velocity.yaw = -fAbs(ai->search_velocity.yaw);
|
||||
} else if (gimbal_ai->yaw > 5.7 && gimbal_ai->yaw < 6.0) {
|
||||
} else if (gimbal_ai->yaw > 5.4 && gimbal_ai->yaw < 6.0) {
|
||||
ai->search_velocity.yaw = fAbs(ai->search_velocity.yaw);
|
||||
}
|
||||
|
||||
|
@ -2,21 +2,21 @@
|
||||
* 配置相关
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "config.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "bsp/flash.h"
|
||||
#include "bsp/flash.h"
|
||||
|
||||
#define CONFIG_BASE_ADDRESS (ADDR_FLASH_SECTOR_11)
|
||||
#define CONFIG_BASE_ADDRESS (ADDR_FLASH_SECTOR_11)
|
||||
|
||||
/* clang-format off */
|
||||
#ifdef DEBUG
|
||||
Config_RobotParam_t param_default = {
|
||||
#else
|
||||
static const Config_RobotParam_t param_default = {
|
||||
#endif
|
||||
/* clang-format off */
|
||||
#ifdef DEBUG
|
||||
Config_RobotParam_t param_default = {
|
||||
#else
|
||||
static const Config_RobotParam_t param_default = {
|
||||
#endif
|
||||
.model = ROBOT_MODEL_INFANTRY,
|
||||
|
||||
.chassis = { /* 底盘模块参数 */
|
||||
@ -58,25 +58,25 @@ static const Config_RobotParam_t param_default = {
|
||||
.gimbal = { /* 云台模块参数 */
|
||||
.pid = {
|
||||
{
|
||||
// /* GIMBAL_PID_YAW_OMEGA_IDX */
|
||||
// .k = 0.25f,
|
||||
// .p = 1.0f,
|
||||
// .i = 1.0f,
|
||||
// .d = 0.0f,
|
||||
// .i_limit = 1.0f,
|
||||
// .out_limit = 1.0f,
|
||||
// .d_cutoff_freq = -1.0f,
|
||||
// .range = -1.0f,
|
||||
// }, {
|
||||
// /* GIMBAL_PID_YAW_ANGLE_IDX */
|
||||
// .k = 12.0f,
|
||||
// .p = 1.0f,
|
||||
// .i = 0.0f,
|
||||
// .d = 0.05f,
|
||||
// .i_limit = 0.0f,
|
||||
// .out_limit = 10.0f,
|
||||
// .d_cutoff_freq = -1.0f,
|
||||
// .range = M_2PI,
|
||||
// /* GIMBAL_PID_YAW_OMEGA_IDX */
|
||||
// .k = 0.25f,
|
||||
// .p = 1.0f,
|
||||
// .i = 1.0f,
|
||||
// .d = 0.0f,
|
||||
// .i_limit = 1.0f,
|
||||
// .out_limit = 1.0f,
|
||||
// .d_cutoff_freq = -1.0f,
|
||||
// .range = -1.0f,
|
||||
// }, {
|
||||
// /* GIMBAL_PID_YAW_ANGLE_IDX */
|
||||
// .k = 12.0f,
|
||||
// .p = 1.0f,
|
||||
// .i = 0.0f,
|
||||
// .d = 0.05f,
|
||||
// .i_limit = 0.0f,
|
||||
// .out_limit = 10.0f,
|
||||
// .d_cutoff_freq = -1.0f,
|
||||
// .range = M_2PI,
|
||||
/* GIMBAL_PID_YAW_OMEGA_IDX */
|
||||
.k = 0.24f,
|
||||
.p = 1.0f,
|
||||
@ -97,25 +97,25 @@ static const Config_RobotParam_t param_default = {
|
||||
.d_cutoff_freq = -1.0f,
|
||||
.range = M_2PI,
|
||||
}, {
|
||||
// /* GIMBAL_PID_PIT_OMEGA_IDX */
|
||||
// .k = 0.35f,
|
||||
// .p = 1.0f,
|
||||
// .i = 0.f,
|
||||
// .d = 0.003f,
|
||||
// .i_limit = 1.0f,
|
||||
// .out_limit = 1.0f,
|
||||
// .d_cutoff_freq = -1.0f,
|
||||
// .range = -1.0f,
|
||||
// }, {
|
||||
// /* GIMBAL_PID_PIT_ANGLE_IDX */
|
||||
// .k = 15.0f,
|
||||
// .p = 1.0f,
|
||||
// .i = 0.0f,
|
||||
// .d = 0.0f,
|
||||
// .i_limit = 0.0f,
|
||||
// .out_limit = 10.0f,
|
||||
// .d_cutoff_freq = -1.0f,
|
||||
// .range = M_2PI,
|
||||
// /* GIMBAL_PID_PIT_OMEGA_IDX */
|
||||
// .k = 0.35f,
|
||||
// .p = 1.0f,
|
||||
// .i = 0.f,
|
||||
// .d = 0.003f,
|
||||
// .i_limit = 1.0f,
|
||||
// .out_limit = 1.0f,
|
||||
// .d_cutoff_freq = -1.0f,
|
||||
// .range = -1.0f,
|
||||
// }, {
|
||||
// /* GIMBAL_PID_PIT_ANGLE_IDX */
|
||||
// .k = 15.0f,
|
||||
// .p = 1.0f,
|
||||
// .i = 0.0f,
|
||||
// .d = 0.0f,
|
||||
// .i_limit = 0.0f,
|
||||
// .out_limit = 10.0f,
|
||||
// .d_cutoff_freq = -1.0f,
|
||||
// .range = M_2PI,
|
||||
/* GIMBAL_PID_PIT_OMEGA_IDX */
|
||||
.k = 0.25f,
|
||||
.p = 1.0f,
|
||||
@ -198,9 +198,9 @@ static const Config_RobotParam_t param_default = {
|
||||
.shoot = BSP_CAN_2,
|
||||
.cap = BSP_CAN_1,
|
||||
}, /* can */
|
||||
}; /* param_default */
|
||||
}; /* param_default */
|
||||
|
||||
static const Config_RobotParam_t param_hero = {
|
||||
static const Config_RobotParam_t param_hero = {
|
||||
.model = ROBOT_MODEL_HERO,
|
||||
|
||||
.chassis = { /* 底盘模块参数 */
|
||||
@ -343,9 +343,13 @@ static const Config_RobotParam_t param_hero = {
|
||||
.shoot = BSP_CAN_2,
|
||||
.cap = BSP_CAN_1,
|
||||
}, /* can */
|
||||
}; /* param_hero */
|
||||
}; /* param_hero */
|
||||
|
||||
static const Config_RobotParam_t param_sentry = {
|
||||
#ifdef DEBUG
|
||||
Config_RobotParam_t param_sentry = {
|
||||
#else
|
||||
static const Config_RobotParam_t param_sentry = {
|
||||
#endif
|
||||
.model = ROBOT_MODEL_SENTRY,
|
||||
|
||||
.chassis = { /* 底盘模块参数 */
|
||||
@ -388,8 +392,8 @@ static const Config_RobotParam_t param_sentry = {
|
||||
.pid = {
|
||||
{
|
||||
/* GIMBAL_PID_YAW_OMEGA_IDX */
|
||||
.k = 0.24f,
|
||||
.p = 1.0f,
|
||||
.k = 0.20f,
|
||||
.p = 0.8f,
|
||||
.i = 0.5f,
|
||||
.d = 0.0f,
|
||||
.i_limit = 1.0f,
|
||||
@ -398,8 +402,8 @@ static const Config_RobotParam_t param_sentry = {
|
||||
.range = -1.0f,
|
||||
}, {
|
||||
/* GIMBAL_PID_YAW_ANGLE_IDX */
|
||||
.k = 10.0f,
|
||||
.p = 1.0f,
|
||||
.k = 8.0f,
|
||||
.p = 0.8f,
|
||||
.i = 0.0f,
|
||||
.d = 0.05f,
|
||||
.i_limit = 0.0f,
|
||||
@ -409,8 +413,8 @@ static const Config_RobotParam_t param_sentry = {
|
||||
}, {
|
||||
|
||||
/* GIMBAL_PID_PIT_OMEGA_IDX */
|
||||
.k = 0.25f,
|
||||
.p = 1.0f,
|
||||
.k = 0.2f,
|
||||
.p = 0.8f,
|
||||
.i = 0.0f,
|
||||
.d = 0.0f,
|
||||
.i_limit = 1.0f,
|
||||
@ -420,7 +424,7 @@ static const Config_RobotParam_t param_sentry = {
|
||||
}, {
|
||||
/* GIMBAL_PID_PIT_ANGLE_IDX */
|
||||
.k = 2.0f,
|
||||
.p = 5.0f,
|
||||
.p = 4.0f,
|
||||
.i = 2.5f,
|
||||
.d = 0.0f,
|
||||
.i_limit = 0.0f,
|
||||
@ -490,11 +494,11 @@ static const Config_RobotParam_t param_sentry = {
|
||||
.shoot = BSP_CAN_2,
|
||||
.cap = BSP_CAN_1,
|
||||
}, /* can */
|
||||
}; /* param_sentry_left */
|
||||
}; /* param_sentry_left */
|
||||
|
||||
/* static const Config_RobotParam_t param_xxx; */
|
||||
/* static const Config_RobotParam_t param_xxx; */
|
||||
|
||||
static const Config_PilotCfg_t cfg_qs = {
|
||||
static const Config_PilotCfg_t cfg_qs = {
|
||||
.param = {
|
||||
.sens_mouse = 0.06f,
|
||||
.sens_rc = 10.0f,
|
||||
@ -522,9 +526,9 @@ static const Config_PilotCfg_t cfg_qs = {
|
||||
.width = 1920,
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
static const Config_PilotCfg_t cfg_zyma = {
|
||||
static const Config_PilotCfg_t cfg_zyma = {
|
||||
.param = {
|
||||
.sens_mouse = 0.06f,
|
||||
.sens_rc = 6.0f,
|
||||
@ -548,13 +552,13 @@ static const Config_PilotCfg_t cfg_zyma = {
|
||||
.move_slow_sense = 1.6f,
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
/* static const Config_PilotCfg_t cfg_xx; */
|
||||
/* static const Config_PilotCfg_t cfg_xx; */
|
||||
|
||||
/* clang-format on */
|
||||
/* clang-format on */
|
||||
|
||||
static const Config_RobotParamMap_t robot_param_map[] = {
|
||||
static const Config_RobotParamMap_t robot_param_map[] = {
|
||||
{"default", ¶m_default},
|
||||
{"infantry", ¶m_default},
|
||||
{"hero", ¶m_hero},
|
||||
@ -564,21 +568,21 @@ static const Config_RobotParamMap_t robot_param_map[] = {
|
||||
// {"sentry_right" ¶m_sentry_right},
|
||||
/* {"xxx", ¶m_xxx}, */
|
||||
{NULL, NULL},
|
||||
};
|
||||
};
|
||||
|
||||
static const Config_PilotCfgMap_t pilot_cfg_map[] = {
|
||||
static const Config_PilotCfgMap_t pilot_cfg_map[] = {
|
||||
{"qs", &cfg_qs},
|
||||
{"zyma", &cfg_zyma},
|
||||
/* {"xx", &cfg_xx}, */
|
||||
{NULL, NULL},
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
/**
|
||||
* \brief 从Flash读取配置信息
|
||||
*
|
||||
* \param cfg 配置信息
|
||||
*/
|
||||
void Config_Get(Config_t *cfg) {
|
||||
void Config_Get(Config_t *cfg) {
|
||||
BSP_Flash_ReadBytes(CONFIG_BASE_ADDRESS, (uint8_t *)cfg, sizeof(*cfg));
|
||||
cfg->pilot_cfg = Config_GetPilotCfg(cfg->pilot_cfg_name);
|
||||
cfg->robot_param = Config_GetRobotParam(cfg->robot_param_name);
|
||||
@ -589,27 +593,27 @@ void Config_Get(Config_t *cfg) {
|
||||
if ((uint32_t)(cfg->robot_param) == UINT32_MAX)
|
||||
cfg->robot_param = ¶m_default;
|
||||
if ((uint32_t)(cfg->pilot_cfg) == UINT32_MAX) cfg->pilot_cfg = &cfg_qs;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* \brief 将配置信息写入Flash
|
||||
*
|
||||
* \param cfg 配置信息
|
||||
*/
|
||||
void Config_Set(Config_t *cfg) {
|
||||
void Config_Set(Config_t *cfg) {
|
||||
osKernelLock();
|
||||
BSP_Flash_EraseSector(11);
|
||||
BSP_Flash_WriteBytes(CONFIG_BASE_ADDRESS, (uint8_t *)cfg, sizeof(*cfg));
|
||||
osKernelUnlock();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief 通过机器人参数名称获取机器人参数的指针
|
||||
*
|
||||
* @param robot_param_name 机器人参数名称
|
||||
* @return const Config_RobotParam_t* 机器人参数的指针
|
||||
*/
|
||||
const Config_RobotParam_t *Config_GetRobotParam(const char *robot_param_name) {
|
||||
const Config_RobotParam_t *Config_GetRobotParam(const char *robot_param_name) {
|
||||
if (robot_param_name == NULL) return NULL;
|
||||
for (size_t j = 0; robot_param_map[j].name != NULL; j++) {
|
||||
if (strcmp(robot_param_map[j].name, robot_param_name) == 0) {
|
||||
@ -617,15 +621,15 @@ const Config_RobotParam_t *Config_GetRobotParam(const char *robot_param_name) {
|
||||
}
|
||||
}
|
||||
return NULL; /* No match. */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief 通过操作手配置名称获取操作手配置的指针
|
||||
*
|
||||
* @param pilot_cfg_name 操作手配置名称
|
||||
* @return const Config_PilotCfg_t* 操作手配置的指针
|
||||
*/
|
||||
const Config_PilotCfg_t *Config_GetPilotCfg(const char *pilot_cfg_name) {
|
||||
const Config_PilotCfg_t *Config_GetPilotCfg(const char *pilot_cfg_name) {
|
||||
if (pilot_cfg_name == NULL) return NULL;
|
||||
for (size_t j = 0; pilot_cfg_map[j].name != NULL; j++) {
|
||||
if (strcmp(pilot_cfg_map[j].name, pilot_cfg_name) == 0) {
|
||||
@ -633,12 +637,13 @@ const Config_PilotCfg_t *Config_GetPilotCfg(const char *pilot_cfg_name) {
|
||||
}
|
||||
}
|
||||
return NULL; /* No match. */
|
||||
}
|
||||
}
|
||||
|
||||
const Config_PilotCfgMap_t *Config_GetPilotNameMap(void) {
|
||||
const Config_PilotCfgMap_t *Config_GetPilotNameMap(void) {
|
||||
return pilot_cfg_map;
|
||||
}
|
||||
}
|
||||
|
||||
const Config_RobotParamMap_t *Config_GetRobotNameMap(void) {
|
||||
const Config_RobotParamMap_t *Config_GetRobotNameMap(void) {
|
||||
return robot_param_map;
|
||||
}
|
||||
}
|
||||
|
@ -153,10 +153,10 @@ int8_t Gimbal_Control(Gimbal_t *g, CMD_GimbalCmd_t *g_cmd, uint32_t now) {
|
||||
g->setpoint.eulr.pit += g_cmd->delta_eulr.pit;
|
||||
|
||||
/* 限制yaw转动范围(待优化) */
|
||||
if (g->setpoint.eulr.yaw > 5.9f && g->setpoint.eulr.yaw < 6.0f) {
|
||||
if (g->setpoint.eulr.yaw > 5.9f && g->setpoint.eulr.yaw < 6.01f) {
|
||||
g->setpoint.eulr.yaw = 5.9f;
|
||||
} else if (g->setpoint.eulr.yaw > 1.4f && g->setpoint.eulr.yaw < 1.5f) {
|
||||
g->setpoint.eulr.yaw = 1.5f;
|
||||
} else if (g->setpoint.eulr.yaw > 1.4f && g->setpoint.eulr.yaw < 1.71f) {
|
||||
g->setpoint.eulr.yaw = 1.71f;
|
||||
}
|
||||
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
#define HEAT_INCREASE_17MM (10.f) /* 每发射一颗17mm弹丸增加10热量 */
|
||||
|
||||
#define BULLET_SPEED_LIMIT_42MM (16.0)
|
||||
#define BULLET_SPEED_LIMIT_17MM (30.0)
|
||||
#define BULLET_SPEED_LIMIT_17MM (25.0)
|
||||
|
||||
/* Private macro ------------------------------------------------------------ */
|
||||
/* Private variables -------------------------------------------------------- */
|
||||
|
Loading…
Reference in New Issue
Block a user