From b56d7e2f98ae368a72fc9d6ef17502ec53b4ab47 Mon Sep 17 00:00:00 2001 From: cxh Date: Fri, 13 Jun 2025 11:29:11 +0800 Subject: [PATCH] Auto commit at 2025-06-13 11:29:11 --- src/radio_ctrl/src/radio_ctrl.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/radio_ctrl/src/radio_ctrl.cpp b/src/radio_ctrl/src/radio_ctrl.cpp index 47de49a..5f6d9c0 100644 --- a/src/radio_ctrl/src/radio_ctrl.cpp +++ b/src/radio_ctrl/src/radio_ctrl.cpp @@ -98,16 +98,19 @@ private: msg.rpm = 0; } - // 油门 / 刹车逻辑 - if (ch_data[1] <= speed[1]) + if (ch_data[7] != 992) { - msg.brake = 1; - msg.rpm = 0; - } - else - { - msg.brake = 0; - msg.rpm = static_cast(MCU_RPM_MAX * (ch_data[1] - speed[1]) / (speed[2] - speed[1])); + // 油门 / 刹车逻辑 + if (ch_data[1] <= speed[1]) + { + msg.brake = 1; + msg.rpm = 0; + } + else + { + msg.brake = 0; + msg.rpm = static_cast(MCU_RPM_MAX * (ch_data[1] - speed[1]) / (speed[2] - speed[1])); + } } // 一键清扫