Greetings and apologies if this has already been answered, but I haven't been able to get a clear answer from looking on Stack Exchange so-far.
I have Quaternions coming from two different IMU's located on the trunk and the back of the head, in order to describe relative rotations between both.
Of course if I would make use of the Euler transform for each of the IMU´s (and subtract to find the relative angles), gimbal locks manifest. But we SHOULDN'T have that problem if we were to represent the relative angles (which is the case, because the aim of this is to show an angular representation that a physiotherapist can understand), because relatives are quite small angles, and probably won't go near +-90.
So what I have in mind is taking the quaternion Q1 that represents the trunk IMU and the quaternion Q2 that represents the head, find the quaternion that rotates Q1 into Q2 (let´s call it Qr) and transform THAT ONE into Eulers.
And it... works. But for some reason I have a "crosstalk" between the pitch and the roll, meaning that they are NOT independent between them.
Is this procedure flawed? What would be a better approach to this?
Actually, I'm having kind of the same problem at the moment (and am still trying to figure out a definitive solution), but I'll try to help out with what I know nevertheless:
From my understanding of quaternion math (which admittedly isn't flawless), your approach is generally a good idea. There may be a few issues with your technical set-up, though:
In general, however, those are technical issues, not necessarily fundamentally mathematical ones, which is why I think that your question may be a bit misplaced on the math StackExchange, and should rather go under Robotics, Signal Processing, or good ol' general StackOverflow (I would have preferred to write this as a comment, but alas, my score around here is still too low)