抽象拟合

This commit is contained in:
ws 2025-07-11 17:44:46 +08:00
parent 100b21b730
commit c76050fb13
7 changed files with 54 additions and 98 deletions

View File

@ -138,3 +138,7 @@
[info] Log at : 2025/7/10|22:12:10|GMT+0800
[info] Log at : 2025/7/11|10:11:25|GMT+0800
[info] Log at : 2025/7/11|17:39:11|GMT+0800

View File

@ -1,39 +1,8 @@
*** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\keil\ARM\ARMCC\Bin'
Build target 'R1'
compiling shoot.cpp...
linking...
R1\R1.axf: Error: L6200E: Symbol __asm___6_main_c_main____REV16 multiply defined (by main.o and main.o).
R1\R1.axf: Error: L6200E: Symbol __asm___6_main_c_main____REVSH multiply defined (by main.o and main.o).
R1\R1.axf: Error: L6200E: Symbol __asm___6_main_c_main____RRX multiply defined (by main.o and main.o).
R1\R1.axf: Error: L6200E: Symbol __asm___9_shoot_cpp_24247dc0___Z7__REVSHs multiply defined (by shoot.o and shoot.o).
R1\R1.axf: Error: L6200E: Symbol __asm___10_djiMotor_c_0818c4ba____REV16 multiply defined (by djimotor.o and djimotor.o).
R1\R1.axf: Error: L6200E: Symbol __asm___10_djiMotor_c_0818c4ba____REVSH multiply defined (by djimotor.o and djimotor.o).
R1\R1.axf: Error: L6200E: Symbol __asm___10_djiMotor_c_0818c4ba____RRX multiply defined (by djimotor.o and djimotor.o).
R1\R1.axf: Error: L6200E: Symbol __asm___16_remote_control_c_d71f1673____REV16 multiply defined (by remote_control.o and remote_control.o).
R1\R1.axf: Error: L6200E: Symbol __asm___16_remote_control_c_d71f1673____REVSH multiply defined (by remote_control.o and remote_control.o).
R1\R1.axf: Error: L6200E: Symbol __asm___16_remote_control_c_d71f1673____RRX multiply defined (by remote_control.o and remote_control.o).
R1\R1.axf: Error: L6200E: Symbol __asm___8_ball_cpp_a168e0ee___Z7__REV16j multiply defined (by ball.o and ball.o).
R1\R1.axf: Error: L6200E: Symbol __asm___8_ball_cpp_a168e0ee___Z7__REVSHs multiply defined (by ball.o and ball.o).
R1\R1.axf: Error: L6200E: Symbol __asm___8_ball_cpp_a168e0ee___Z5__RRXj multiply defined (by ball.o and ball.o).
R1\R1.axf: Error: L6200E: Symbol __asm___9_shoot_cpp_24247dc0___Z7__REV16j multiply defined (by shoot.o and shoot.o).
R1\R1.axf: Error: L6200E: Symbol __asm___9_shoot_cpp_24247dc0___Z5__RRXj multiply defined (by shoot.o and shoot.o).
R1\R1.axf: Error: L6200E: Symbol __asm___10_initTask_c_1acb3ba9____REV16 multiply defined (by inittask.o and inittask.o).
R1\R1.axf: Error: L6200E: Symbol __asm___10_initTask_c_1acb3ba9____REVSH multiply defined (by inittask.o and inittask.o).
R1\R1.axf: Error: L6200E: Symbol __asm___10_initTask_c_1acb3ba9____RRX multiply defined (by inittask.o and inittask.o).
R1\R1.axf: Error: L6200E: Symbol __asm___12_ballTask_cpp_ball___Z7__REV16j multiply defined (by balltask.o and balltask.o).
R1\R1.axf: Error: L6200E: Symbol __asm___12_ballTask_cpp_ball___Z7__REVSHs multiply defined (by balltask.o and balltask.o).
R1\R1.axf: Error: L6200E: Symbol __asm___12_ballTask_cpp_ball___Z5__RRXj multiply defined (by balltask.o and balltask.o).
R1\R1.axf: Error: L6200E: Symbol __asm___13_encodeCan_cpp_dca83ed4___Z7__REV16j multiply defined (by encodecan.o and encodecan.o).
R1\R1.axf: Error: L6200E: Symbol __asm___13_encodeCan_cpp_dca83ed4___Z7__REVSHs multiply defined (by encodecan.o and encodecan.o).
R1\R1.axf: Error: L6200E: Symbol __asm___13_encodeCan_cpp_dca83ed4___Z5__RRXj multiply defined (by encodecan.o and encodecan.o).
R1\R1.axf: Error: L6200E: Symbol __asm___11_nucTask_cpp_3f7e051c___Z7__REV16j multiply defined (by nuctask.o and nuctask.o).
R1\R1.axf: Error: L6200E: Symbol __asm___11_nucTask_cpp_3f7e051c___Z7__REVSHs multiply defined (by nuctask.o and nuctask.o).
R1\R1.axf: Error: L6200E: Symbol __asm___11_nucTask_cpp_3f7e051c___Z5__RRXj multiply defined (by nuctask.o and nuctask.o).
R1\R1.axf: Error: L6200E: Symbol __asm___13_shootTask_cpp_shoot___Z7__REV16j multiply defined (by shoottask.o and shoottask.o).
R1\R1.axf: Error: L6200E: Symbol __asm___13_shootTask_cpp_shoot___Z7__REVSHs multiply defined (by shoottask.o and shoottask.o).
R1\R1.axf: Error: L6200E: Symbol __asm___13_shootTask_cpp_shoot___Z5__RRXj multiply defined (by shoottask.o and shoottask.o).
Not enough information to list image symbols.
Not enough information to list load addresses in the image map.
Finished: 2 information, 0 warning and 30 error messages.
"R1\R1.axf" - 30 Error(s), 0 Warning(s).
Target not created.
Build Time Elapsed: 00:00:02
Program Size: Code=31388 RO-data=1832 RW-data=284 ZI-data=32260
FromELF: creating hex file...
"R1\R1.axf" - 0 Error(s), 0 Warning(s).
Build Time Elapsed: 00:00:05

View File

@ -1 +1 @@
2025/7/10 17:27:12
2025/7/11 5:53:28

View File

@ -153,52 +153,34 @@
<Name>-U00160029510000164E574E32 -O2254 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(2BA01477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -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/>
<Breakpoint>
<Bp>
<Number>0</Number>
<Type>0</Type>
<LineNumber>89</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>0</BreakIfRCount>
<Filename>../Core/Src/main.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
</Breakpoint>
<WatchWindow1>
<Ww>
<count>0</count>
<WinNumber>1</WinNumber>
<ItemText>rc_ctrl,0x0A</ItemText>
<ItemText>shoot,0x0A</ItemText>
</Ww>
<Ww>
<count>1</count>
<WinNumber>1</WinNumber>
<ItemText>shoot,0x0A</ItemText>
</Ww>
<Ww>
<count>2</count>
<WinNumber>1</WinNumber>
<ItemText>ball,0x0A</ItemText>
</Ww>
<Ww>
<count>3</count>
<WinNumber>1</WinNumber>
<ItemText>nucbuf,0x10</ItemText>
</Ww>
<Ww>
<count>4</count>
<WinNumber>1</WinNumber>
<ItemText>drop_message,0x0A</ItemText>
</Ww>
<Ww>
<count>5</count>
<WinNumber>1</WinNumber>
<ItemText>cmd_fromnuc</ItemText>
</Ww>
<Ww>
<count>6</count>
<WinNumber>1</WinNumber>
<ItemText>a,0x0A</ItemText>
</Ww>
<Ww>
<count>7</count>
<WinNumber>1</WinNumber>
<ItemText>and1,0x0A</ItemText>
</Ww>
<Ww>
<count>8</count>
<WinNumber>1</WinNumber>
<ItemText>test_distance</ItemText>
<ItemText>ball</ItemText>
</Ww>
</WatchWindow1>
<MemoryWindow4>
@ -1091,7 +1073,7 @@
<Group>
<GroupName>User/task</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>

View File

@ -6,7 +6,7 @@ static osThreadId_t thread_alert;
volatile uint32_t drop_message = 0;
uint8_t nucbuf[10];
uint8_t nucbuf[18];
uint8_t packet[32]; // 假设最大数据包长度为 32 字节
static void NUC_CBLTCallback(void)
@ -150,18 +150,18 @@ int8_t NUC_RawParse(NUC_t *n) {
else
{
if (nucbuf[9] != TAIL) goto error;
if (nucbuf[17] != TAIL) goto error;
instance.data[3] = nucbuf[4];
instance.data[2] = nucbuf[3];
instance.data[1] = nucbuf[2];
instance.data[0] = nucbuf[1];
instance.data[3] = nucbuf[8];
instance.data[2] = nucbuf[7];
instance.data[1] = nucbuf[6];
instance.data[0] = nucbuf[5];
n->vision.x = instance.x[0];
instance.data[7] = nucbuf[8];
instance.data[6] = nucbuf[7];
instance.data[5] = nucbuf[6];
instance.data[4] = nucbuf[5];
instance.data[7] = nucbuf[16];
instance.data[6] = nucbuf[15];
instance.data[5] = nucbuf[14];
instance.data[4] = nucbuf[13];
n->vision.y = instance.x[1];
}

View File

@ -15,6 +15,7 @@ extern int ball_exit;
#define I_ANGLE 49
#define O_ANGLE 85
#define WAIT_POS 75
#define HANGDING_POS 89
// PE11 气缸git stash apply
@ -105,7 +106,7 @@ void Ball::Move_Extend()
}
if (extern_key == OUT)
{
xiaomi.position = O_ANGLE;
xiaomi.position = HANGDING_POS;
}
}

View File

@ -38,8 +38,8 @@ const fp32 Shoot::M2006_angle_PID[3] = {15, 0.1, 0};
#define WAIT_POS -170
#define CHANEGE_POS -205
#define GO_ERROR 1.0f
#define Tigger_DO 0
#define Tigger_ZERO 125
#define Tigger_DO -10
#define Tigger_ZERO 115
#define Tigger_ERROR 3
float knob_increment;
@ -86,20 +86,20 @@ void Shoot::trigger_control()
CAN_cmd_200(result, 0, 0, 0, &hcan1);
}
// float shoot_fitting(float x)
// {
// return 0.2006334f * x * x + 25.788123f * x + -169.32157 + 3.8f-3.8f;
// }
float shoot_fitting(float x)
{
return 0.67076341f * x * x + 20.212423f * x + -154.53966f + 1.0f;
}
// float shoot_fitting(float x)
// {
// return 1.4255807f * x * x + 12.138447f * x + -136.35306f;
// }
float pass_fitting(float x)
{
return 1.1790172f * x * x + 15.983755f * x + -172.04664f + 1.6f -2.0f;
return 0.36807548f * x * x + 25.002169f * x + -199.2727f;
}
void Shoot::distanceGet(const NUC_t &nuc_v)
@ -231,8 +231,7 @@ void Shoot::rc_mode()
#if ONE_CONTROL == 0
//float and1=-1.0f;
float and1=0;
float and1=2.0f;
void Shoot::shoot_control()
{
@ -243,7 +242,8 @@ void Shoot::shoot_control()
{
case VSION:
//fire_pos = distance; // 视觉拟合的力
fire_pos =shoot_fitting(test_distance)+2.0f+and1;
// fire_pos =shoot_fitting(distance)+and1;
fire_pos =shoot_fitting(distance)+2.0f-2.3f;
//fire_pos = INIT_POS + knob_increment; // 根据旋钮值调整发射位置
switch (rc_key)