From ec2dae1c83cd8667365d8a1553bc836557addc96 Mon Sep 17 00:00:00 2001 From: Lizongdi <1210855344@qq.com> Date: Thu, 21 May 2026 08:58:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=AB=8B=E9=9D=A2=E5=B9=B3?= =?UTF-8?q?=E9=9D=A2=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Core/Src/robot_state.c | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/robot_state.c b/diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/robot_state.c index 7fc0942..3f84ae9 100644 --- a/diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/robot_state.c +++ b/diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/robot_state.c @@ -448,7 +448,17 @@ void auto_forward_state_do(void) Act_Speed =Speed_Ctrl; if(Ref_Speed >= 5000) Ref_Speed = 5000; - SetMoveMotorSpeed(Ref_Speed); + if (0 == GV.PV.knife_descending_height) + { + SetMoveMotorSpeed(Ref_Speed); + } + else + { + GV.LeftFrontMotor.Target_Velcity = Ref_Speed; + GV.RightFrontMotor.Target_Velcity = -Ref_Speed; + GV.LeftBackMotor.Target_Velcity = Ref_Speed; + GV.RightBackMotor.Target_Velcity = -Ref_Speed; + } } void auto_backward_state_do(void) @@ -470,7 +480,17 @@ void auto_backward_state_do(void) Act_Speed =Speed_Ctrl; if(Ref_Speed >= 5000) Ref_Speed = 5000; - SetMoveMotorSpeed(-Ref_Speed); + if (0 == GV.PV.knife_descending_height) + { + SetMoveMotorSpeed(-Ref_Speed); + } + else + { + GV.LeftFrontMotor.Target_Velcity = -Ref_Speed; + GV.RightFrontMotor.Target_Velcity = Ref_Speed; + GV.LeftBackMotor.Target_Velcity = -Ref_Speed; + GV.RightBackMotor.Target_Velcity = Ref_Speed; + } }