mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 05:04:08 +08:00
Canonicalize alignment quaternion
This commit is contained in:
parent
933c32c921
commit
53eac6e94e
@ -1596,6 +1596,7 @@ void Ekf::calcExtVisRotMat()
|
||||
// calculate the quaternion delta between the EV and EKF reference frames at the EKF fusion time horizon
|
||||
Quatf q_error = _state.quat_nominal * _ev_sample_delayed.quat.inversed();
|
||||
q_error.normalize();
|
||||
q_error.canonicalize();
|
||||
|
||||
// convert to a delta angle and apply a spike and low pass filter
|
||||
Vector3f rot_vec = q_error.to_axis_angle();
|
||||
@ -1623,6 +1624,7 @@ void Ekf::calcExtVisRotMat()
|
||||
// convert filtered vector to a quaternion and then to a rotation matrix
|
||||
q_error.from_axis_angle(_ev_rot_vec_filt);
|
||||
q_error.normalize();
|
||||
q_error.canonicalize();
|
||||
_ev_rot_mat = Dcmf(q_error); // rotation from EV reference to EKF reference
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user