mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 05:15:25 +03:00
Preparation for conversion to parameter groups 6
This commit is contained in:
parent
cb2356ba76
commit
4c435fccae
23 changed files with 93 additions and 88 deletions
|
@ -70,7 +70,6 @@ static float smallAngleCosZ = 0;
|
|||
static float magneticDeclination = 0.0f; // calculated at startup from config
|
||||
|
||||
static imuRuntimeConfig_t imuRuntimeConfig;
|
||||
static pidProfile_t *pidProfile;
|
||||
|
||||
STATIC_UNIT_TESTED float q0 = 1.0f, q1 = 0.0f, q2 = 0.0f, q3 = 0.0f; // quaternion of sensor frame relative to earth frame
|
||||
static float rMat[3][3];
|
||||
|
@ -116,18 +115,13 @@ static float calculateThrottleAngleScale(uint16_t throttle_correction_angle)
|
|||
return (1800.0f / M_PIf) * (900.0f / throttle_correction_angle);
|
||||
}
|
||||
|
||||
void imuConfigure(
|
||||
imuConfig_t *imuConfig,
|
||||
pidProfile_t *initialPidProfile,
|
||||
uint16_t throttle_correction_angle
|
||||
)
|
||||
void imuConfigure(uint16_t throttle_correction_angle)
|
||||
{
|
||||
imuRuntimeConfig.dcm_kp = imuConfig->dcm_kp / 10000.0f;
|
||||
imuRuntimeConfig.dcm_ki = imuConfig->dcm_ki / 10000.0f;
|
||||
imuRuntimeConfig.acc_unarmedcal = imuConfig->acc_unarmedcal;
|
||||
imuRuntimeConfig.small_angle = imuConfig->small_angle;
|
||||
imuRuntimeConfig.dcm_kp = imuConfig()->dcm_kp / 10000.0f;
|
||||
imuRuntimeConfig.dcm_ki = imuConfig()->dcm_ki / 10000.0f;
|
||||
imuRuntimeConfig.acc_unarmedcal = imuConfig()->acc_unarmedcal;
|
||||
imuRuntimeConfig.small_angle = imuConfig()->small_angle;
|
||||
|
||||
pidProfile = initialPidProfile;
|
||||
fc_acc = calculateAccZLowPassFilterRCTimeConstant(5.0f); // Set to fix value
|
||||
throttleAngleScale = calculateThrottleAngleScale(throttle_correction_angle);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue