From 1434cee8c035255c907b6b014b523bc7e7cad7a5 Mon Sep 17 00:00:00 2001 From: xinyang <895639507@qq.com> Date: Sun, 4 Aug 2019 17:23:11 +0800 Subject: [PATCH] fix bug. --- energy/src/energy/send/send.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/energy/src/energy/send/send.cpp b/energy/src/energy/send/send.cpp index c140ae8..c680bbd 100644 --- a/energy/src/energy/send/send.cpp +++ b/energy/src/energy/send/send.cpp @@ -24,10 +24,10 @@ void Energy::sendEnergy() { pitch_rotation = BIG_PITCH_AIM_KP * pitch_rotation + BIG_PITCH_AIM_KI * sum_pitch + BIG_PITCH_AIM_KD * (pitch_rotation - last_pitch); } else if (is_chassis) { - sum_yaw += yaw_rotation - mcuData.curr_yaw; - sum_pitch += pitch_rotation - mcuData.curr_pitch; - yaw_rotation = BIG_YAW_AIM_KP * (yaw_rotation - mcuData.curr_yaw) + BIG_YAW_AIM_KI * sum_yaw; - pitch_rotation = BIG_PITCH_AIM_KP * (pitch_rotation - mcuData.curr_pitch) + BIG_PITCH_AIM_KI * sum_pitch; + sum_yaw += yaw_rotation - mcu_data.curr_yaw; + sum_pitch += pitch_rotation - mcu_data.curr_pitch; + yaw_rotation = BIG_YAW_AIM_KP * (yaw_rotation - mcu_data.curr_yaw) + BIG_YAW_AIM_KI * sum_yaw; + pitch_rotation = BIG_PITCH_AIM_KP * (pitch_rotation - mcu_data.curr_pitch) + BIG_PITCH_AIM_KI * sum_pitch; } } else if (is_small){ sum_yaw += yaw_rotation;