I have noticed a potential issue regarding the Simscape block "Transform Sensor".
I am simulating the rotation of a simple body by using a gimbal joint. The inputs into the gimbal joint are three desired angles (roll, pitch, yaw). Now I am using the "Transform Sensor" to output the quaternion "Q" describing the motion between the base frame (World) and the follower frame (Rotating Body). At the same time, I am calculating the quaternion via a MATLAB Function block with the equations I found from reference to convert Euler angles to quaternion. For example, see the section "Euler angles to quaternion conversion" in the following link:
Now if I compare the quaternion entries computed by the Transform Sensor block and the quaternion computed from the Euler angle equations I use, there is no difference as long as I only have a single rotation about roll, pitch, or yaw. But once I combine two or more movements, there is an error between the two quaternion calculations.
Can you explain the reason for the difference? Is there a different convention I need to apply? Or do I have to change the settings of the transform sensor?
Best Answer