1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +01:00

Change settings for baro altitude offset correction

This commit is contained in:
Oleg Semyonov 2013-07-26 22:14:08 +03:00
parent aa560653d4
commit 1bfa66c2b6
2 changed files with 7 additions and 10 deletions

View File

@ -69,15 +69,8 @@ static int32_t init(stateFilter *self)
this->baroOffset = 0.0f;
this->first_run = 100;
// Low pass filter configuration to calculate offset of barometric altitude sensor.
// Defaults: updates at 5 Hz, tau = 300s settle time, exp(-(1/f)/tau) ~= 0.9993335555062
// Set BaroOffsetFilterTau = 0 to completely disable baro offset updates.
RevoSettingsData revoSettings;
RevoSettingsInitialize();
RevoSettingsGet(&revoSettings);
this->baroGPSOffsetCorrectionAlpha = (revoSettings.BaroGPSOffsetCorrectionTau < 0.0001f) ?
1.0f : expf(-(1.0f / revoSettings.BaroGPSOffsetCorrectionFrequency) / revoSettings.BaroGPSOffsetCorrectionTau);
RevoSettingsBaroGPSOffsetCorrectionAlphaGet(&this->baroGPSOffsetCorrectionAlpha);
return 0;
}

View File

@ -2,8 +2,12 @@
<object name="RevoSettings" singleinstance="true" settings="true" category="State">
<description>Settings for the revo to control the algorithm and what is updated</description>
<field name="FusionAlgorithm" units="" type="enum" elements="1" options="None,Complementary,Complementary+Mag,INS13Indoor,INS13Outdoor" defaultvalue="Complementary"/>
<field name="BaroGPSOffsetCorrectionFrequency" units="Hz" type="float" elements="1" defaultvalue="5"/>
<field name="BaroGPSOffsetCorrectionTau" units="s" type="float" elements="1" defaultvalue="300"/>
<!-- Low pass filter configuration to calculate offset of barometric altitude sensor.
Defaults: updates at 5 Hz, tau = 300s settle time, exp(-(1/f)/tau) ~= 0.9993335555062
Set BaroGPSOffsetCorrectionAlpha = 1.0 to completely disable baro offset updates. -->
<field name="BaroGPSOffsetCorrectionAlpha" units="" type="float" elements="1" defaultvalue="0.9993335555062"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="true" updatemode="onchange" period="0"/>
<telemetryflight acked="true" updatemode="onchange" period="0"/>