-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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: relax preflight yaw check when possible #8424
Conversation
Jenkins test this please |
src/modules/ekf2/ekf2_main.cpp
Outdated
float yaw_test_limit; | ||
uint32_t control_mode = 0; | ||
_ekf.get_control_mode(&control_mode); | ||
bool doing_ne_aiding = (control_mode & (2 << 2)) // Using GPS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the definition of the control status flag, this should be 1<<2
. I suggest you introduce some variables for the masks, in the form of static constexpr uint32_t filter_control_status_u::gps_fused_mask = 1 << 2
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will rework to use the exisiting filter_control_status_u type and rebase.
f93429e
to
02ec733
Compare
@bkueng I have reworked it to use the exisiting filter_control_status_u type and rebased. |
…te aiding When the EKF is not fusing in observations from the NE global reference frame, the tolerance to yaw errors is much higher. This changes will prevent false triggering of the preflight fail check when operating indoors without GPS where mag field errors can be high.
02ec733
to
0f5b4f9
Compare
Reduce max yaw error when not using global frame aiding data to prevent large yaw yaw changes after takeoff.
9b696ef
to
f54eda5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @priseborough. This works better.
I still get the 'EKF INTERNAL CHECKS` error when I have the vehicle on the desk right next to the laptop - but looking at the mag, there are definitely strong interferences in this location.
Here's a test log:
https://logs.px4.io/plot_app?log=7ed33794-2a63-4d98-a4b6-fb4f41fa7302
src/modules/ekf2/ekf2_main.cpp
Outdated
@@ -1264,9 +1267,24 @@ void Ekf2::run() | |||
_vel_d_innov_lpf = beta * _vel_d_innov_lpf + alpha * constrain(innovations.vel_pos_innov[2], | |||
-_vel_innov_spike_lim, _vel_innov_spike_lim); | |||
|
|||
// set the max allowed yaw innovaton depending on whether we are not aiding navigation using | |||
// observations in the NE reference frame. | |||
float yaw_test_limit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move the definition of filter_control_status_u _ekf_control_mask
in here, to minimize its scope, since it's only used here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
I've looked at the log and the reasons for the pre-arm failure has two causes. One is a large transient magnetic yaw error produced when the vehicle is moved. The other is a large and persistent vertical innovation offset that exceeds the 1.5m tolerance and appears to be the result of a combination of sensor errors and previous movement. Flying in a height control mode with this amount vertical innovation and the resulting vertical velocity error would produce unacceptable height variation after takeoff and prevent the vehicle from landing due to excessive vertical velocity offset. |
c8b4784
to
ad9c253
Compare
When the EKF is not fusing in position or velocity observations in a global reference frame to constrain navigation errors, the tolerance to yaw errors is much higher. Examples of this include operation using only optical flow (which is in body frame) or operation without aiding where only attitude and height is estimated.
These changes will help reduce false triggering associated with indoor operation where magnetic interference and anomaly levels are high.