I'm working with a system of IMUs where each IMU outputs an orientation quaternion which is then converted into Euler angles. I want to be able to standardize the meaning of the Euler angles across all of the sensors. However, the way the sensors are set up, the $x$-axis (heading) of the sensors are pointing in different directions. So the EulerX (and EulerY) angles from each sensor represent different kinds of movement (one represents what could be considered roll of the body and another pitch of the body). I want to be able to make it so that the EulerX output represents roll of the body on every sensor.
Now this seems doable by just switching the EulerX and EulerY components on the output (i.e. $[1.5, .3, .5]$ -> $[.3, 1.5, .5]$ where [roll, pitch, yaw]) however this seems inelegant and feels like it's missing a true understanding of how quaternions work. So I'm wondering if there's a method for determining the transformation quaternion that I can multiply each sensor by that will satisfy the swapping of the Euler angles laid out above when the quaternion is converted to Euler Angles.
If it helps the sensors are set up so that one sensor is pointing forward on the rigid body (the direction I want) another is set at a $90°$ angle and another is set at a $180°$ angle (with relatively similar pitch and roll values)
I had some success finding a representation of the sensor turned $180°$ by right multiplying the orientation quaternion (q1) by a $180°$ yaw rotation quaternion. This returned the following Euler results: $q1 = [eX, eY, eZ]$ -> $[-eX, -eY, eZ-180°]$
However when I try to do the same for the sensor that is $90°$ off by right multiplying by a quaternion representing a $90°$ rotation. That doesn't work. Clearly there's a lack of understanding I have about what these right hand multiplications represent.
In : quat = np.matrix([0.6094978, -0.757683, 0.05746635, -0.2261116]) print(Calc_Euler(quat))
Out : [-1.7323621052571858, -0.27608459761902809, -0.38654233181239173]
So these are the Euler Angles I get for the quaternion off the sensor. Now if I apply a right hand 90 degree rotation here's what I get.
In : quat = np.matrix([0.6094978, -0.757683, 0.05746635, -0.2261116])
sensfr = np.matrix([1,0,0,1])/np.linalg.norm([1,0,0,1])
new_q = QuatProd(quat, sensfr)
Out : [-2.087188748187, 1.251957112363, -0.9254284237615]