mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-16 03:30:35 +08:00
EKF: fix initialization of local position validity 2 (#820)
The `_deadreckon_time_exceeded` flag is used in `local_position_is_valid()`. This means that `_params.valid_timeout_max` after startup, in my observed case 5 seconds, the local position switche from valid to invalid and then after a while back to valid again. With this fix, the local position is flagged invalid from boot and gets validated after the first aiding event. Co-authored-by: Julian Oes <julian@oes.ch>
This commit is contained in:
@@ -71,11 +71,9 @@ class EkfFusionLogicTest : public ::testing::Test {
|
||||
TEST_F(EkfFusionLogicTest, doNoFusion)
|
||||
{
|
||||
// GIVEN: a tilt and heading aligned filter
|
||||
// WHEN: having no aiding source EKF should not have a valid position estimate
|
||||
|
||||
// TODO: for the first 5 second it still has some valid local position
|
||||
// that needs to change
|
||||
EXPECT_TRUE(_ekf->local_position_is_valid());
|
||||
// WHEN: having no aiding source
|
||||
// THEN: EKF should not have a valid position estimate
|
||||
EXPECT_FALSE(_ekf->local_position_is_valid());
|
||||
|
||||
_sensor_simulator.runSeconds(4);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user