ekf2 selector fix SITL lockstep

- ekf2 selector don't register lockstep until first attitude publication
 - sensors module register lockstep component
 - enable multi-EKF2 in SITL
This commit is contained in:
Daniel Agar
2020-10-28 09:42:41 -04:00
parent b1dc1b1ecd
commit 2c874f1cd9
3 changed files with 29 additions and 10 deletions
+9
View File
@@ -178,6 +178,7 @@ private:
VehicleIMU *_vehicle_imu_list[MAX_SENSOR_COUNT] {};
int _lockstep_component{-1};
/**
* Update our local parameter cache.
@@ -297,6 +298,8 @@ Sensors::~Sensors()
}
perf_free(_loop_perf);
px4_lockstep_unregister_component(_lockstep_component);
}
bool Sensors::init()
@@ -639,6 +642,12 @@ void Sensors::Run()
parameter_update_poll();
}
if (_lockstep_component == -1) {
_lockstep_component = px4_lockstep_register_component();
}
px4_lockstep_progress(_lockstep_component);
perf_end(_loop_perf);
}