I have two motion capturing sensors that are worn above and below the knee as shown in the image below:
Each sensor can stream its own rotation as a body-to-world frame rotation matrix and/or body-to-world frame quaternion. Can anyone advise how I calculate the angle $\Theta$ as shown in the drawing below:
I think I need the relative rotation in the $y$ coordinate but I'm not sure where to start. I've tried using the relative orientation like so:
relativeOrientation = upperSensorQuaternion * inverse(lowerSensorQuaternion)
Extracting the Euler value of $y$ from the resultant quaternion seems to work when a person is standing up but not when lying down because there is additional rotation about the $x$ and $z$ as well. Could anyone advise on how to correctly calculate $\Theta$? Many thanks.