mirror of https://github.com/ArduPilot/ardupilot
AP_NavEKF2: set primary to first healthy core
This commit is contained in:
parent
2ab2afc86a
commit
ee78e2d618
|
@ -481,9 +481,19 @@ bool NavEKF2::InitialiseFilter(void)
|
||||||
// Update Filter States - this should be called whenever new IMU data is available
|
// Update Filter States - this should be called whenever new IMU data is available
|
||||||
void NavEKF2::UpdateFilter(void)
|
void NavEKF2::UpdateFilter(void)
|
||||||
{
|
{
|
||||||
if (core) {
|
if (!core) {
|
||||||
for (uint8_t i=0; i<num_cores; i++) {
|
return;
|
||||||
core[i].UpdateFilter();
|
}
|
||||||
|
for (uint8_t i=0; i<num_cores; i++) {
|
||||||
|
core[i].UpdateFilter();
|
||||||
|
}
|
||||||
|
|
||||||
|
// set primary to first healthy filter
|
||||||
|
primary = 0;
|
||||||
|
for (uint8_t i=0; i<num_cores; i++) {
|
||||||
|
if (core[i].healthy()) {
|
||||||
|
primary = i;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue