Comparing the angle of two poses

Hello everyone,
I want to compare the orientation (not the XYZ coordinates) of two poses of the robot and receive a skalar angle between the two.
say the first pose is:
P1 = p[0, 0, 0, -1.21608, -1.21457, 1.2004]
and the second pose is:
P2 = p[0, 0, 0, 0.012, 2.217, -2.218]

The difference in rotation between P1 and P2 should be pretty much exactly 1.570 or 90°

I’ve been testing using the method shown on this page below Axis Angle Result, but this gives me a result of 2.52 or about 144°

The goal of this is to essentially create my own version of the safety feature ‘Tool Direction’ to use as verification if a pose direction received from my camera system is possible to reach/makes sense before moving to it.

A little side question:
If I edit the pose P1 in the Polyscope gui it shows the rotation vector values as 2.425, 2.422, -2.401. Why is it not showing the original URScript values?

Thanks for helping.

1 Like

Solved it,
my error was that I directly applied the formula from the link when instead I would have needed to create a vector that represents the base and rotate that around the rotation vector of the robot.
After that I can apply the calculation from the link and get the result I want.

1 Like