Skip to content

Conversation

henrykotze
Copy link
Contributor

Solved Problem

  • the observation variance of the external vision (ev) height is compared to that of the ev orientation variance. This comparison does not make sense, and inhibit the correct observation variance when EV is not supplying orientation measurements.

If there are some insight behind this comparison check, it would be awesome to understand and learn 😄

- the observation variance of the external vision (ev) height is
  compared to that of the ev attitude variance. This comparison does not
make sense, and inhibit the correct observation variance when EV is not
supplying attitude measurements
@henrykotze
Copy link
Contributor Author

Seems that if our EV is providing NED measurements including heading, then we dont need to make use of _ev_q_error_filt..
So we should probably put in a check in the if case which frame the measurements is coming frame.

then it would make sense to use the variance on the attitude as check when the measurement if in the FRD frame.

@dagar dagar self-requested a review October 8, 2025 15:56
@dagar dagar added this to PX4 EKF Oct 8, 2025
@dagar dagar moved this to 🏗 In progress in PX4 EKF Oct 8, 2025
@dagar
Copy link
Member

dagar commented Oct 8, 2025

Can we capture the different cases more explicitly? NED vs FRD, orientation provided (and enabled?) or not, etc.

@henrykotze
Copy link
Contributor Author

Yes, we should handle the different cases more explicitly. Even if measurements are in NED, some parts of the code still affect the variance lower bound as if it were in the FRD frame.

We should also consider how yaw resets and calibration offsets affect magnetometer fusion — see this discussion

Lastly, it might make sense to include vision in isNorthEastAidingActive. I haven’t explored all the side effects yet, but it seems reasonable so far.

@henrykotze
Copy link
Contributor Author

Just to expand on the discussion link:

bool continuing_conditions_passing =
    ((_params.mag_fusion_type == MagFuseType::INIT)
  || (_params.mag_fusion_type == MagFuseType::AUTO)
  || (_params.mag_fusion_type == MagFuseType::HEADING))
  && _control_status.flags.tilt_align
  && (_control_status.flags.yaw_align || (!_control_status.flags.ev_yaw && !_control_status.flags.yaw_align))
  && mag_sample.mag.longerThan(0.f)
  && mag_sample.mag.isAllFinite();

This section of code is found within the mag_control.cpp file, and should probably be adjusted to incorporate whether the EV yaw measurements are FRD or NED frame.

In the discussion link I expand on some issues that we have experienced, but from what I have gathered, we dont want to start fusing magnetometer measurement if the EV measurements are in the FRD frame. However we would like to if it is in the NED.

Thus if the EV yaw measurements are NED, yaw alignment can occur on the EV measurements, which then will trigger the magnetometer measurements to start fusing.

any comments on any possible misunderstanding that I have would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

2 participants