Dealing with position drift and yaw misalignment (R_ev_to_ekf) during flight with External Vision

When using external vision data, I notice that if there is an initial yaw misalignment between the camera (EV) and the drone (EKF), the drone tends to drift or fly diagonally after flying a short distance.
I understand that _ev_q_error_filt and its rotation matrix R_ev_to_ekf are supposed to handle this via online yaw alignment. However, before the filter converges, the position pos gets calculated incorrectly.

  • How does the EKF dynamically update _ev_q_error_filt while flying?
  • Is there a way to pre-align the yaw before takeoff to prevent this initial diagonal drift, or are there specific EKF2 parameters I should tune to speed up the convergence?

Hello, can someone help me?