mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 13:53:34 +08:00
ekf2: split gnss pos/vel flags
They can be selected independently in the control parameter, so there is no reason why they should share the same flag.
This commit is contained in:
committed by
Mathieu Bresciani
parent
da3a0656d4
commit
2aaa54037c
@@ -117,7 +117,7 @@ void EkfWrapper::disableGpsFusion()
|
||||
|
||||
bool EkfWrapper::isIntendingGpsFusion() const
|
||||
{
|
||||
return _ekf->control_status_flags().gps;
|
||||
return _ekf->control_status_flags().gnss_vel || _ekf->control_status_flags().gnss_pos;
|
||||
}
|
||||
|
||||
void EkfWrapper::enableGpsHeadingFusion()
|
||||
|
||||
@@ -103,7 +103,8 @@ TEST_F(EkfBasicsTest, initialControlMode)
|
||||
// THEN: EKF control status should be reasonable
|
||||
EXPECT_EQ(1, (int) _ekf->control_status_flags().tilt_align);
|
||||
EXPECT_EQ(1, (int) _ekf->control_status_flags().yaw_align);
|
||||
EXPECT_EQ(0, (int) _ekf->control_status_flags().gps);
|
||||
EXPECT_EQ(0, (int) _ekf->control_status_flags().gnss_pos);
|
||||
EXPECT_EQ(0, (int) _ekf->control_status_flags().gnss_vel);
|
||||
EXPECT_EQ(0, (int) _ekf->control_status_flags().opt_flow);
|
||||
EXPECT_EQ(1, (int) _ekf->control_status_flags().mag_hdg);
|
||||
EXPECT_EQ(0, (int) _ekf->control_status_flags().mag_3D);
|
||||
@@ -158,7 +159,8 @@ TEST_F(EkfBasicsTest, gpsFusion)
|
||||
// THEN: EKF should fuse GPS, but no other position sensor
|
||||
EXPECT_EQ(1, (int) _ekf->control_status_flags().tilt_align);
|
||||
EXPECT_EQ(1, (int) _ekf->control_status_flags().yaw_align);
|
||||
EXPECT_EQ(1, (int) _ekf->control_status_flags().gps);
|
||||
EXPECT_EQ(1, (int) _ekf->control_status_flags().gnss_pos);
|
||||
EXPECT_EQ(1, (int) _ekf->control_status_flags().gnss_vel);
|
||||
EXPECT_EQ(0, (int) _ekf->control_status_flags().opt_flow);
|
||||
EXPECT_EQ(1, (int) _ekf->control_status_flags().mag_hdg);
|
||||
EXPECT_EQ(0, (int) _ekf->control_status_flags().mag_3D);
|
||||
|
||||
Reference in New Issue
Block a user