Relative Euler Angles
Calculate the relative Euler Angles between two frames
The Relative Euler angles sensor calculates the Euler angles from the Relative Rotation Matrix that defines the rotation from frame_a to frame_b. The algorithm is described in the Algorithm section.
1. Only one set of results is given by the sensor. Given the set of outputs θ1, θ2, and θ3, the alternate solutions can be obtained as:
- For the non-classical sequences (e.g. [1,2,3] or [2,3,1]): θ1±π, −θ2±π, θ3±π.
- For classical or repeating sequences (e.g. [3,1,3] or [1,2,1]): θ1±π, −θ2, θ3±π.
2. The output angles may become discontinuous if the rotation of the body goes through the singularity of the selected Euler Angle rotation sequence. For classical (repeating) sequences the singularity is at sinθ2=0. For non-classical (non-repeating) sequences the singularity is at cosθ2=0.
3. The output angles may also become discontinuous if they are close to the boundary of ±π.
Real signal of dimension 3x1 that specifies the Euler Angles (in radians) based on the rotation sequence selected via the Rotation Sequence parameter.
The sequence of rotations. e.g. [1,2,3]: First rotation w.r.t. x, second rotation w.r.t. y', and third rotation w.r.t. z''.
(The algorithm below is based on: G. Meyer and H. Q. Lee, "A Method for Expanding a Direction Cosine Matrix Into an Euler Sequence of Rotations," NASA TM X-1384, 1967)
I = RotSeq;
J = RotSeq;
K = RotSeq;
and rotation matrix A, is given by:
A = transpose(frame_a.R.T);
where frame_a.R.T is the absolute orientation matrix of framea.
if I <> K then
L = I - mod(J,3);
C = if L == 2 then -1 else L;
TH = -atan2(A[K,J]*C,A[K,K]);
X = -sin(TH);
Y = cos(TH);
X = A[I,K]*X - A[I,J]*C*Y;
Y = A[J,J]*Y - A[J,K]*C*X;
X = -A[K,I]*C;
Y = A[I,I]*Y + A[J,I]*C*X;
N = 6 - (K + J);
L = N - mod(I,3);
TH = -atan2(A[K,J],A[K,N]*C);
X = -A[N,N]*X + A[N,J]*C*Y;
Y = A[J,J]*Y - A[J,N]*C*X;
X = A[J,I]*X - A[N,I]*C*Y;
Y = A[K,K];
TH = -atan2(X,Y);
TH = -atan2(X,Y);
Download Help Document
What kind of issue would you like to report? (Optional)