I want to convert rotations given as quaternion from sensors to Unity. The sensors (documentation here) axis are the following ones:
I don't know how to map axis other than Z is up for the axis. Note that I don't really mind if I have a global rotation offset. I just want the sensors (they are multiple ones) relative orientation to be the same in Unity that in real life
Given this other answer I think the following code should to the transformation:
Quaternion ConvertToUnity(Quaternion input) {
return new Quaternion(
-input.y,
-input.z,
-input.x,
input.w
);
}
Is that correct?