Need help combining Rotations

Hi everyone,

I’m physically connecting 2 Rotation sensors in the real world and transfering their data to UE4 (lets call their data RotSensor1(t), RotSensor2(t)).

Their “offset” in the real world doesnt change, so every rotation is picked up by both sensors. Knowing this “offset”, which can be determined at any given time, here t0=0, I would like to determine the orientation of the second sensor at any given point of time using the orientation of the first one at this specific time. Here I use Quaternions.
Like:

`RotSensor2[i] = Func(RotSensor1[0], RotSensor2[0], RotSensor1[i]);`

Mathematically defined like that:

`RotSensor2(t) = f(RotSensor1(t0), RotSensor2(t0), RotSensor1(t))`

In theory I thought

`RotSensor2[i] = RotSensor1[i] * (RotSensor1[0].Inverse() * RotSensor2[0]);`

is the way to go but it doesn’t seem work.

Does anyone have another idea? It does not need to use any Quaternion at all, every solution is apprechiated. I tried so much, flipping around the multiplications, tried stuff with qpq-1 and using Transforms, but I cant find any solution to this problem.

Basically it should be thougt of bringing sensor 2 in local space of sensor 1 with:

`LocalQuatSensor1 = (RotSensor1[0].Inverse() * RotSensor2[0]);`

Thanks, have a great day and stay safe

Ok, before I start, I need to know your exact setup. Is your setup like this?

This is what I think you are asking: You have RotSensor1 and RotSensor2 giving the rotation of each joint in local space. And what you want is to know RotSensor2’s rotation in world space? Also, are these 3-D rotary sensors (sensing pitch/roll/yaw)?