energy change
This commit is contained in:
1 parent
6f517f7853
commit
6453a977e1
1 file changed
+7
-3
@@ -44,8 +44,12 @@ void Energy::judgeShootInGimbal(){
|
|||||||
static float sum_pitch = 0;
|
static float sum_pitch = 0;
|
||||||
sum_yaw += yaw_rotation;
|
sum_yaw += yaw_rotation;
|
||||||
sum_pitch += pitch_rotation;
|
sum_pitch += pitch_rotation;
|
||||||
#ifndef AIM_KP AIM_KI
|
#ifndef AIM_KP
|
||||||
yaw_rotation = AIM_KP * yaw_rotation + AIM_KI * sum_yaw;
|
yaw_rotation = AIM_KP * yaw_rotation;
|
||||||
pitch_rotation = AIM_KP * pitch_rotation + AIM_KI * sum_pitch;
|
pitch_rotation = AIM_KP * pitch_rotation;
|
||||||
|
#endif
|
||||||
|
#ifndef AIM_KI
|
||||||
|
yaw_rotation = yaw_rotation + AIM_KI * sum_yaw;
|
||||||
|
pitch_rotation = pitch_rotation * pitch_rotation + AIM_KI * sum_pitch;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user