ARKit: ARBodyAnchor rotation values

I want to get the rotation values from ARBodyAnchor.

I see the values in the console:

bodyAnchor: <ARBodyAnchor: 0x2828fc540 identifier="DDD1B2B4-A3BF-4F0E-8B83-2049540C3654" sessionIdentifier="E9E1006B-D4E0-A6A9-161E-FF942B1F5956" tracked=NO transform=<translation=(-0.174489 -0.388840 -1.825961) rotation=(6.16° -20.73° 4.05°)>>

How can I get the 3 values 6.16°, -20.73° and 4.05°?
Hello,

Those rotation values are part of the anchor's debugDescription String, and are not available directly. You would need to derive them from the transform property.

If you conduct an internet search for "Euler angles from rotation matrix" you will find many results that explain how you can compute the angles.

You can also file an enhancement request using Feedback Assistant if you feel that it would be valuable to be able to access these angles directly.

Additionally, note that often times it is unnecessary and in some cases problematic to use Euler angles, so make sure that your use case is not better suited by another rotation mechanism (like a matrix or quaternions).
ARKit: ARBodyAnchor rotation values
 
 
Q