From dba447dc934de10f9e4909c9164fe1a069c7cdaa Mon Sep 17 00:00:00 2001 From: bmy <2583236812@qq.com> Date: Sun, 5 May 2024 16:28:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E8=BD=AE=E5=AD=90?= =?UTF-8?q?=E8=BF=90=E5=8A=A8=E6=96=B9=E5=90=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/by_motion.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/by_motion.c b/app/by_motion.c index 5ca2f3c..6b72fef 100644 --- a/app/by_motion.c +++ b/app/by_motion.c @@ -54,6 +54,10 @@ void by_motion_update_speed(void) v_wheel[2] = speed->v_x + speed->v_y + RX_RY * speed->v_w; v_wheel[3] = speed->v_x - speed->v_y - RX_RY * speed->v_w; + // 根据安装方式调整轮子方向 + v_wheel[1] *= -1; + v_wheel[2] *= -1; + for (uint8_t i = 0; i < 4; i++) { motion_speed_data[i] = (int16_t)v_wheel[i];