Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ekf2: allow yaw estimator to run when disarmed (if not at rest) #19398

Closed
wants to merge 2 commits into from

Conversation

dagar
Copy link
Member

@dagar dagar commented Mar 25, 2022

This is to allow yaw estimator to run and potential perform yaw align before the vehicle is armed. Potentially useful for cases like #19393.

} else if (gps_checks_passing && !_control_status.flags.yaw_align && (_params.mag_fusion_type == MAG_FUSE_TYPE_NONE)) {
// If no mag is used, align using the yaw estimator (if available)
if (resetYawToEKFGSF()) {
_information_events.flags.yaw_aligned_to_imu_gps = true;
ECL_INFO("Yaw aligned using IMU and GPS");
resetVelocityToGps(_gps_sample_delayed);
resetHorizontalPositionToGps(_gps_sample_delayed);
}
}

@comperem
Copy link

hello, this seems to be waiting on something.

it's not clear what, though.

What's the status of this proposed change?

I'm ready to test when it's ready.

@dagar dagar force-pushed the pr-ekf2_yaw_estimator_when_disarmed branch from 4089473 to 733f0b4 Compare April 1, 2022 15:18
@dagar
Copy link
Member Author

dagar commented Apr 1, 2022

hello, this seems to be waiting on something.

it's not clear what, though.

What's the status of this proposed change?

I'm ready to test when it's ready.

@comperem it needs testing. In particular we want to be sure it doesn't fail (yaw estimator converging to something random) if you're not actually moving, but the vehicle_at_rest flag isn't set. For example when there's no airframe selected there's no land detector running and EKF defaults to vehicle_at_rest = false.

@comperem
Copy link

comperem commented Apr 4, 2022

hello, this seems to be waiting on something.
it's not clear what, though.
What's the status of this proposed change?
I'm ready to test when it's ready.

@comperem it needs testing. In particular we want to be sure it doesn't fail (yaw estimator converging to something random) if you're not actually moving, but the vehicle_at_rest flag isn't set. For example when there's no airframe selected there's no land detector running and EKF defaults to vehicle_at_rest = false.

Oki doki. I'll give it a try. The yaw is pretty terrible and drifts visibly sitting on the table as it is. I'll provide an update after testing.

@priseborough
Copy link
Contributor

This leaves the yaw estimator vulnerable to GPS errors before flight for air vehicle use and is not safe.

@dagar dagar reopened this May 31, 2022
@dagar
Copy link
Member Author

dagar commented May 31, 2022

This leaves the yaw estimator vulnerable to GPS errors before flight for air vehicle use and is not safe.

@priseborough I was wondering if we could capture the underlying requirement (eg sufficient lateral acceleration?) rather than relying on the overly broad arm/disarm. People like @comperem are using the system outside of a typical flight controller scenario.

@dagar dagar force-pushed the pr-ekf2_yaw_estimator_when_disarmed branch 2 times, most recently from ac65a48 to 4bf9b4d Compare January 28, 2023 02:04
@dagar
Copy link
Member Author

dagar commented Jan 28, 2023

The yaw estimator will now only run if the vehicle is not at rest, GPS velocity is less than EKF2_REQ_SACC, and motion is not excessive (acceleration norm check).

@dagar dagar force-pushed the pr-ekf2_yaw_estimator_when_disarmed branch from 4bf9b4d to 5038a21 Compare January 28, 2023 02:11
 - added new excessive motion check for running yaw estimator
 - move all handling into gps_control
@dagar dagar force-pushed the pr-ekf2_yaw_estimator_when_disarmed branch from 4a63971 to 013d619 Compare February 21, 2023 14:51
@dagar dagar closed this Dec 5, 2023
@dagar dagar deleted the pr-ekf2_yaw_estimator_when_disarmed branch December 5, 2023 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants