修正前进后退档位上报相反的问题
This commit is contained in:
parent
ee5f90c9ff
commit
26d7ce5bf6
@ -122,6 +122,20 @@ void CanDecoder::handle_mcu_status_2(const sweeperMsg::CanFrame& msg)
|
|||||||
int motorTemp = raw_motor_temp - 30;
|
int motorTemp = raw_motor_temp - 30;
|
||||||
int feedback_gear = (ctrl_status >> 2) & 0x03;
|
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<std::mutex> lock(ctx_.mtx);
|
std::lock_guard<std::mutex> lock(ctx_.mtx);
|
||||||
ctx_.info.controllerTemp = controllerTemp;
|
ctx_.info.controllerTemp = controllerTemp;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user