修复lqr_u计算bug

This commit is contained in:
myperworld committed 2025-10-07 23:05:03 +08:00
1 parent c059348614
commit a0b9323774
1 file changed
-9
-9
View File
@@ -668,17 +668,8 @@ void lqr_balance_loop()
distance_zeropoint = LQR_distance; // 位移零点重置
pid_lqr_u.error_prev = 0; // 输出积分清零 测试
}
// 没有摇杆指令,小车微微移动,需要重置位移零点,让小车自己回来
// if ((wrobot_move_stop_flag == 1) && (abs(LQR_speed) < 0.5))
// {
// distance_zeropoint = LQR_distance; // 位移零点重置
// pid_lqr_u.error_prev = 0; // 输出积分清零 测试
// wrobot_move_stop_flag = 0;
// }
// 实时重置位移零点和积分情形
// if (abs(robot_speed_diff) > 10 || (abs(LQR_speed) > 15)
// || jump_flag > 0 || wrobot.joyy != 0 || sitting_down )
if (abs(robot_speed_diff) > 10 || (abs(LQR_speed) > 15)
|| wrobot.joyy != 0 || sitting_down )
{