1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Merge branch 'corvuscorax/OP-1412_Gyrodrift_issue' into rel-14.06

This commit is contained in:
Corvus Corax 2014-07-24 22:39:15 +02:00
commit c88630bbea
3 changed files with 12 additions and 7 deletions

View File

@ -205,6 +205,15 @@ static filterResult filter(stateFilter *self, stateEstimation *state)
this->work.updated |= state->updated; this->work.updated |= state->updated;
// check magnetometer alarm, discard any magnetometer readings if not OK
// during initialization phase (but let them through afterwards)
SystemAlarmsAlarmData alarms;
SystemAlarmsAlarmGet(&alarms);
if (alarms.Magnetometer != SYSTEMALARMS_ALARM_OK && !this->inited) {
UNSET_MASK(state->updated, SENSORUPDATES_mag);
UNSET_MASK(this->work.updated, SENSORUPDATES_mag);
}
// Get most recent data // Get most recent data
IMPORT_SENSOR_IF_UPDATED(gyro, 3); IMPORT_SENSOR_IF_UPDATED(gyro, 3);
IMPORT_SENSOR_IF_UPDATED(accel, 3); IMPORT_SENSOR_IF_UPDATED(accel, 3);
@ -349,12 +358,8 @@ static filterResult filter(stateFilter *self, stateEstimation *state)
INSCovariancePrediction(dT); INSCovariancePrediction(dT);
if (IS_SET(this->work.updated, SENSORUPDATES_mag)) { if (IS_SET(this->work.updated, SENSORUPDATES_mag)) {
SystemAlarmsAlarmData alarms;
SystemAlarmsAlarmGet(&alarms);
if (alarms.Magnetometer == SYSTEMALARMS_ALARM_OK) {
sensors |= MAG_SENSORS; sensors |= MAG_SENSORS;
} }
}
if (IS_SET(this->work.updated, SENSORUPDATES_baro)) { if (IS_SET(this->work.updated, SENSORUPDATES_baro)) {
sensors |= BARO_SENSOR; sensors |= BARO_SENSOR;

View File

@ -5,7 +5,7 @@
10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
0.007, 0.007, 0.007, 0.007, 0.007, 0.007, 0.007, 0.007,
0.0001, 0.0001, 0.0001"> 0.000001, 0.000001, 0.000001">
<elementnames> <elementnames>
<elementname>PositionNorth</elementname> <elementname>PositionNorth</elementname>
<elementname>PositionEast</elementname> <elementname>PositionEast</elementname>

View File

@ -45,7 +45,7 @@
</field> </field>
<access gcs="readwrite" flight="readwrite"/> <access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/> <telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="throttled" period="1000"/> <telemetryflight acked="false" updatemode="periodic" period="1000"/>
<logging updatemode="manual" period="0"/> <logging updatemode="manual" period="0"/>
</object> </object>
</xml> </xml>