From c76050fb13cd0d794d4495d74c78970fab698460 Mon Sep 17 00:00:00 2001
From: ws <1621320660@qq.com>
Date: Fri, 11 Jul 2025 17:44:46 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8A=BD=E8=B1=A1=E6=8B=9F=E5=90=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
MDK-ARM/.vscode/keil-assistant.log | 4 ++
MDK-ARM/.vscode/uv4.log | 41 +++-----------------
MDK-ARM/.vscode/uv4.log.lock | 2 +-
MDK-ARM/R1.uvoptx | 60 +++++++++++-------------------
User/device/nuc.c | 20 +++++-----
User/module/ball.cpp | 3 +-
User/module/shoot.cpp | 22 +++++------
7 files changed, 54 insertions(+), 98 deletions(-)
diff --git a/MDK-ARM/.vscode/keil-assistant.log b/MDK-ARM/.vscode/keil-assistant.log
index de28053..9a72189 100644
--- a/MDK-ARM/.vscode/keil-assistant.log
+++ b/MDK-ARM/.vscode/keil-assistant.log
@@ -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
+
diff --git a/MDK-ARM/.vscode/uv4.log b/MDK-ARM/.vscode/uv4.log
index d3613a4..4ae2bc7 100644
--- a/MDK-ARM/.vscode/uv4.log
+++ b/MDK-ARM/.vscode/uv4.log
@@ -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
diff --git a/MDK-ARM/.vscode/uv4.log.lock b/MDK-ARM/.vscode/uv4.log.lock
index e3043fd..bfe56a6 100644
--- a/MDK-ARM/.vscode/uv4.log.lock
+++ b/MDK-ARM/.vscode/uv4.log.lock
@@ -1 +1 @@
-2025/7/10 17:27:12
\ No newline at end of file
+2025/7/11 5:53:28
\ No newline at end of file
diff --git a/MDK-ARM/R1.uvoptx b/MDK-ARM/R1.uvoptx
index 533a043..d903d28 100644
--- a/MDK-ARM/R1.uvoptx
+++ b/MDK-ARM/R1.uvoptx
@@ -153,52 +153,34 @@
-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)
-
+
+
+ 0
+ 0
+ 89
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ ../Core/Src/main.c
+
+
+
+
0
1
- rc_ctrl,0x0A
+ shoot,0x0A
1
1
- shoot,0x0A
-
-
- 2
- 1
- ball,0x0A
-
-
- 3
- 1
- nucbuf,0x10
-
-
- 4
- 1
- drop_message,0x0A
-
-
- 5
- 1
- cmd_fromnuc
-
-
- 6
- 1
- a,0x0A
-
-
- 7
- 1
- and1,0x0A
-
-
- 8
- 1
- test_distance
+ ball
@@ -1091,7 +1073,7 @@
User/task
- 0
+ 1
0
0
0
diff --git a/User/device/nuc.c b/User/device/nuc.c
index 30d580e..db4abe5 100644
--- a/User/device/nuc.c
+++ b/User/device/nuc.c
@@ -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];
}
diff --git a/User/module/ball.cpp b/User/module/ball.cpp
index e27b6db..5e56951 100644
--- a/User/module/ball.cpp
+++ b/User/module/ball.cpp
@@ -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;
}
}
diff --git a/User/module/shoot.cpp b/User/module/shoot.cpp
index e01e204..2194794 100644
--- a/User/module/shoot.cpp
+++ b/User/module/shoot.cpp
@@ -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)