From 6bf8ab7f1faa3da17914e33821586e5f1e5bdb9d Mon Sep 17 00:00:00 2001 From: "LIN\\54376" <543769318@qq.com> Date: Fri, 26 Sep 2025 16:55:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E6=8E=89MX=5FQUADSPI=5FInit(?= =?UTF-8?q?);=E6=96=B0=E5=A2=9E=EF=BC=9A=E5=9C=A8=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E9=87=8C=E5=AE=9E=E6=97=B6=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E8=A1=A5=E5=81=BF=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../.org.eclipse.egit.core.cmp/.project | 11 ------- .../org.eclipse.core.resources.prefs | 2 -- .settings/language.settings.xml | 4 +-- Core/Protobuf/Proto/bsp_IV.proto | 1 + Core/Protobuf/Proto/bsp_PV.proto | 2 ++ Core/Src/FSM.c | 4 --- Core/Src/main.c | 2 +- Core/Src/robot_state.c | 29 +++++++++++++++++++ 8 files changed, 35 insertions(+), 20 deletions(-) delete mode 100644 .metadata/.plugins/org.eclipse.egit.core/.org.eclipse.egit.core.cmp/.project delete mode 100644 .metadata/.plugins/org.eclipse.egit.core/.org.eclipse.egit.core.cmp/.settings/org.eclipse.core.resources.prefs diff --git a/.metadata/.plugins/org.eclipse.egit.core/.org.eclipse.egit.core.cmp/.project b/.metadata/.plugins/org.eclipse.egit.core/.org.eclipse.egit.core.cmp/.project deleted file mode 100644 index 3c10856..0000000 --- a/.metadata/.plugins/org.eclipse.egit.core/.org.eclipse.egit.core.cmp/.project +++ /dev/null @@ -1,11 +0,0 @@ - - - .org.eclipse.egit.core.cmp - - - - - - - - diff --git a/.metadata/.plugins/org.eclipse.egit.core/.org.eclipse.egit.core.cmp/.settings/org.eclipse.core.resources.prefs b/.metadata/.plugins/org.eclipse.egit.core/.org.eclipse.egit.core.cmp/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c0..0000000 --- a/.metadata/.plugins/org.eclipse.egit.core/.org.eclipse.egit.core.cmp/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml index d032c56..19601ec 100644 --- a/.settings/language.settings.xml +++ b/.settings/language.settings.xml @@ -5,7 +5,7 @@ - + @@ -17,7 +17,7 @@ - + diff --git a/Core/Protobuf/Proto/bsp_IV.proto b/Core/Protobuf/Proto/bsp_IV.proto index 34b8185..5dd44a7 100644 --- a/Core/Protobuf/Proto/bsp_IV.proto +++ b/Core/Protobuf/Proto/bsp_IV.proto @@ -14,6 +14,7 @@ message IV_struct_define{ int32 Robot_Current_Left= 9; int32 Robot_Current_Right= 10; + int32 Robot_Error_Left= 11; int32 Robot_Error_Right= 12; diff --git a/Core/Protobuf/Proto/bsp_PV.proto b/Core/Protobuf/Proto/bsp_PV.proto index 4a50aef..143b948 100644 --- a/Core/Protobuf/Proto/bsp_PV.proto +++ b/Core/Protobuf/Proto/bsp_PV.proto @@ -2,6 +2,8 @@ syntax = "proto3"; message PV_struct_define{ int32 Robot_ChgLength= 1; + double Robot_AutoSpeedBase=2; double Robot_ManualSpeedBase=3; + }; diff --git a/Core/Src/FSM.c b/Core/Src/FSM.c index d0a559a..560c67f 100644 --- a/Core/Src/FSM.c +++ b/Core/Src/FSM.c @@ -450,11 +450,7 @@ void GF_Dispatch()//2ms调用一次 给车体速度等赋值 IV.Robot_CurrentState = CurrentMoveState; - action_perfrom(MoveTransitions, sizeof(MoveTransitions) / sizeof(transition_t), CurrentMoveState);//结构体数组/大小/当前状态 - // action_perfrom(SwingTransitions,sizeof(SwingTransitions) / sizeof(transition_t), CurrentSwingState); - // action_perfrom(TiltTransitions, sizeof(TiltTransitions) / sizeof(transition_t), CurrentTiltState); - } diff --git a/Core/Src/main.c b/Core/Src/main.c index 1bede13..191a6a7 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -143,7 +143,7 @@ int main(void) MX_USART6_UART_Init(); MX_TIM8_Init(); MX_LWIP_Init(); - MX_QUADSPI_Init(); + //MX_QUADSPI_Init(); MX_LPUART1_UART_Init(); MX_ADC2_Init(); /* USER CODE BEGIN 2 */ diff --git a/Core/Src/robot_state.c b/Core/Src/robot_state.c index 534577f..5412f5d 100644 --- a/Core/Src/robot_state.c +++ b/Core/Src/robot_state.c @@ -215,6 +215,21 @@ void Auto() } break; case 2: + //水平 + if ((AM_Pa.ExpectationAngle >= 45 && AM_Pa.ExpectationAngle <= 135)) + { + AM_Pa.ExpectationAngle = 90 - GV.Right_Compensation/100.0; + } + else if ((AM_Pa.ExpectationAngle >= -135 && AM_Pa.ExpectationAngle <= -45)) + { + AM_Pa.ExpectationAngle = -90 + GV.Left_Compensation/100.0; + } + + //垂直 + else if ((AM_Pa.ExpectationAngle > -45 && AM_Pa.ExpectationAngle < 45)) + { + AM_Pa.ExpectationAngle = 0 - GV.Left_Compensation/100.0 + GV.Right_Compensation/100.0; + } VehicleAutoForward(angle, GV.Left_Compensation/100.0, GV.Right_Compensation/100.0);//自动前进 break; @@ -247,6 +262,20 @@ void Auto() } break; case 4: + if ((AM_Pa.ExpectationAngle >= 45 && AM_Pa.ExpectationAngle <= 135)) + { + AM_Pa.ExpectationAngle = 90 + GV.Left_Compensation/100.0; + } + if ((AM_Pa.ExpectationAngle >= -135 && AM_Pa.ExpectationAngle <= -45)) + { + AM_Pa.ExpectationAngle = - 90 - GV.Right_Compensation/100.0; + } + + //垂直 + if ((AM_Pa.ExpectationAngle > -45 && AM_Pa.ExpectationAngle < 45)) + { + AM_Pa.ExpectationAngle = 0 - GV.Left_Compensation/100.0 + GV.Right_Compensation/100.0; + } VehicleAutoBackward(angle, GV.Left_Compensation/100.0, GV.Right_Compensation/100.0);//自动后退 break;