mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-02 14:13:42 -04:00
6 lines
198 B
Matlab
6 lines
198 B
Matlab
% normalise the quaternion
|
|
function quaternion = normQuat(quaternion)
|
|
|
|
quatMag = sqrt(quaternion(1)^2 + quaternion(2)^2 + quaternion(3)^2 + quaternion(4)^2);
|
|
quaternion(1:4) = quaternion / quatMag;
|