mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 20:35:33 +03:00
unit test bugs
This commit is contained in:
parent
56181a87c8
commit
b0af988a75
2 changed files with 3 additions and 9 deletions
|
@ -214,8 +214,7 @@ bool pidAntiGravityEnabled(void);
|
|||
extern float axisError[XYZ_AXIS_COUNT];
|
||||
void applyItermRelax(const int axis, const float iterm,
|
||||
const float gyroRate, float *itermErrorRate, float *currentPidSetpoint);
|
||||
void applyAbsoluteControl(const int axis, const float gyroRate, const bool itermRelaxIsEnabled,
|
||||
const float setpointLpf, const float setpointHpf, float *currentPidSetpoint, float *itermErrorRate);
|
||||
void applyAbsoluteControl(const int axis, const float gyroRate, float *currentPidSetpoint, float *itermErrorRate);
|
||||
void rotateItermAndAxisError();
|
||||
float pidLevel(int axis, const pidProfile_t *pidProfile,
|
||||
const rollAndPitchTrims_t *angleTrim, float currentPidSetpoint);
|
||||
|
|
|
@ -589,8 +589,6 @@ TEST(pidControllerTest, testAbsoluteControl) {
|
|||
pidStabilisationState(PID_STABILISATION_ON);
|
||||
|
||||
float gyroRate = 0;
|
||||
float setpointLpf = 6;
|
||||
float setpointHpf = 30;
|
||||
|
||||
float itermErrorRate = 10;
|
||||
float currentPidSetpoint = 10;
|
||||
|
@ -600,16 +598,13 @@ TEST(pidControllerTest, testAbsoluteControl) {
|
|||
ASSERT_NEAR(10.8, itermErrorRate, calculateTolerance(10.8));
|
||||
ASSERT_NEAR(10.8, currentPidSetpoint, calculateTolerance(10.8));
|
||||
|
||||
itermRelaxIsEnabled = true;
|
||||
applyAbsoluteControl(FD_PITCH, gyroRate, itermRelaxIsEnabled, setpointLpf, setpointHpf,
|
||||
¤tPidSetpoint, &itermErrorRate);
|
||||
applyAbsoluteControl(FD_PITCH, gyroRate, ¤tPidSetpoint, &itermErrorRate);
|
||||
ASSERT_NEAR(10.8, itermErrorRate, calculateTolerance(10.8));
|
||||
ASSERT_NEAR(10.8, currentPidSetpoint, calculateTolerance(10.8));
|
||||
|
||||
gyroRate = -53;
|
||||
axisError[FD_PITCH] = -60;
|
||||
applyAbsoluteControl(FD_PITCH, gyroRate, itermRelaxIsEnabled, setpointLpf, setpointHpf,
|
||||
¤tPidSetpoint, &itermErrorRate);
|
||||
applyAbsoluteControl(FD_PITCH, gyroRate, ¤tPidSetpoint, &itermErrorRate);
|
||||
ASSERT_NEAR(-79.2, itermErrorRate, calculateTolerance(-79.2));
|
||||
ASSERT_NEAR(-79.2, currentPidSetpoint, calculateTolerance(-79.2));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue