Auto commit at 2025-06-13 11:29:11

This commit is contained in:
cxh 2025-06-13 11:29:11 +08:00
parent 2c842f87ec
commit b56d7e2f98

View File

@ -98,16 +98,19 @@ private:
msg.rpm = 0; msg.rpm = 0;
} }
// 油门 / 刹车逻辑 if (ch_data[7] != 992)
if (ch_data[1] <= speed[1])
{ {
msg.brake = 1; // 油门 / 刹车逻辑
msg.rpm = 0; if (ch_data[1] <= speed[1])
} {
else msg.brake = 1;
{ msg.rpm = 0;
msg.brake = 0; }
msg.rpm = static_cast<uint8_t>(MCU_RPM_MAX * (ch_data[1] - speed[1]) / (speed[2] - speed[1])); else
{
msg.brake = 0;
msg.rpm = static_cast<uint8_t>(MCU_RPM_MAX * (ch_data[1] - speed[1]) / (speed[2] - speed[1]));
}
} }
// 一键清扫 // 一键清扫