Transformation of a quaternion representing a rotation from one coordinate system to another

I get the quaternion from the sensor data, which is in the coordinate system Y = up, X = right and Z = back. Bridge X = forward, Y = right, Z = up.

So, OX = Y, OY = Z and OZ = -X.

I have a function that can convert quaternions to 4by4 matrices, but I donโ€™t know where to go from here. Any help would be greatly appreciated.

+7
system quaternions coordinate
source share
1 answer

Quaternions in the form [X, Y, Z, W] are equivalent to the axial angles of rotation, where W depends only on the rotation angle (but not on the axis), and X, Y, Z - the rotation axis is multiplied by sin (angle / 2). Since X, Y, Z have this property, you can simply swap and undo them, as if you were converting a three-dimensional coordinate between them. To convert from your coordinate system to your sensor, you can simply do this:

  MyQuat.X = -SensorQuat.Z
 MyQuat.Y = SensorQuat.X
 MyQuat.Z = SensorQuat.Y
 MyQuat.W = SensorQuat.W
+8
source share

All Articles