mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 01:05:27 +03:00
More isolated pid_unittests
Refactor iterm_relax to iterm_relax_axis Isolate pidLevel test Isolate pidHorizon tests remove if UNIT_TEST revert to iterm_relax from iterm_relax_axis
This commit is contained in:
parent
9b51fb3216
commit
87b2eeb2fd
3 changed files with 185 additions and 151 deletions
|
@ -23,6 +23,7 @@
|
|||
#include <stdbool.h>
|
||||
#include "common/time.h"
|
||||
#include "common/filter.h"
|
||||
#include "common/axis.h"
|
||||
#include "pg/pg.h"
|
||||
|
||||
#define MAX_PID_PROCESS_DENOM 16
|
||||
|
@ -198,3 +199,17 @@ bool pidOsdAntiGravityActive(void);
|
|||
bool pidOsdAntiGravityMode(void);
|
||||
void pidSetAntiGravityState(bool newState);
|
||||
bool pidAntiGravityEnabled(void);
|
||||
|
||||
#ifdef UNIT_TEST
|
||||
#include "sensors/acceleration.h"
|
||||
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 rotateItermAndAxisError();
|
||||
float pidLevel(int axis, const pidProfile_t *pidProfile,
|
||||
const rollAndPitchTrims_t *angleTrim, float currentPidSetpoint);
|
||||
float calcHorizonLevelStrength(void);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue