diff --git a/src/communication/mqtt_report/src/can/can_decoder.cpp b/src/communication/mqtt_report/src/can/can_decoder.cpp index 71ff200..d4c9b0b 100644 --- a/src/communication/mqtt_report/src/can/can_decoder.cpp +++ b/src/communication/mqtt_report/src/can/can_decoder.cpp @@ -122,6 +122,20 @@ void CanDecoder::handle_mcu_status_2(const sweeperMsg::CanFrame& msg) int motorTemp = raw_motor_temp - 30; int feedback_gear = (ctrl_status >> 2) & 0x03; + switch (feedback_gear) + { + case 1: + feedback_gear = 2; // 原1(错误后退)改为2(正确后退) + break; + case 2: + feedback_gear = 1; // 原2(错误前进)改为1(正确前进) + break; + case 0: + case 3: + default: + break; + } + { std::lock_guard lock(ctx_.mtx); ctx_.info.controllerTemp = controllerTemp;