Skip to content

Commit ad7f7af

Browse files
CarlOlssonpriseborough
authored andcommitted
ekf: correct quaternion multiplication order
1 parent d6351bd commit ad7f7af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

EKF/ekf_helper.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ bool Ekf::realignYawGPS()
516516

517517
// apply the change in attitude quaternion to our newest quaternion estimate
518518
// which was already taken out from the output buffer
519-
_output_new.quat_nominal = _state_reset_status.quat_change * _output_new.quat_nominal;
519+
_output_new.quat_nominal = _output_new.quat_nominal * _state_reset_status.quat_change;
520520

521521
// capture the reset event
522522
_state_reset_status.quat_counter++;
@@ -756,7 +756,7 @@ bool Ekf::resetMagHeading(Vector3f &mag_init, bool increase_yaw_var, bool update
756756

757757
// apply the change in attitude quaternion to our newest quaternion estimate
758758
// which was already taken out from the output buffer
759-
_output_new.quat_nominal = _state_reset_status.quat_change * _output_new.quat_nominal;
759+
_output_new.quat_nominal = _output_new.quat_nominal * _state_reset_status.quat_change;
760760
}
761761

762762
// capture the reset event

0 commit comments

Comments
 (0)