Transform Matrix in Transform Sensor Block. SimMechanics

2 views (last 30 days)
Transform Matrix describes rotation concerning axes oX, oY, oZ, and using this matrix I can count this 3 angles. But if my model at first rotate conserning oX on an angle A, than again conserning oX on an angle B, and at the end rotate conserning oZ on an angle C. Is there some methods to calcutale angles A and B separately using only Transform Matrix?
(Now I can calculate total rotational angle conserning oX like (A+B), but to control my model I need to calculate them separately.)

Accepted Answer

Sebastian Castro
Sebastian Castro on 19 Aug 2015
I'd recommend extracting the rotation angle as a quaternion instead of the transform matrix. With the extra information in the quaternion representation, you actually can decompose this into individual axes rotations.
If you happen to have the Aerospace Blockset, there is a "Quaternions to Rotation Angles" block... but that's not a likely thing.
You could look through the File Exchange to find other users who have implemented these conversions -- for example, this link. Or, you could implement your own conversion using the Wikipedia page as reference, for instance.
- Sebastian

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!