Hi,
Unless I'm doing something wrong, it seems there's an error in the Euler angles returned by a
jacobi.Frame
import numpy as np
from scipy.spatial.transform import Rotation
import jacobi
for k in range(10):
q_xyzw = np.array([2 * np.random.rand() - 1, 2 * np.random.rand() - 1, 2 * np.random.rand() - 1, 2 * np.random.rand() - 1])
q_xyzw = q_xyzw / np.linalg.norm(q_xyzw)
print("")
print("jacobi euler: ", *[f"{e:+2.5f}" for e in jacobi.Frame.from_quaternion(0, 0, 0, q_xyzw[3], q_xyzw[0], q_xyzw[1], q_xyzw[2]).euler[3:]])
print(" scipy euler: ", *[f"{e:+2.5f}" for e in Rotation.from_quat(q_xyzw).as_euler("xyz")])
1 year ago
1 year ago
Hi Alban,
We're currently using the extrinsic Euler XYZ convention, which is available in scipy by uppercase
.as_euler("XYZ")
Moreover, Euler angles are not unique and we're using the solution which minimizes x with x >= 0. I'm not sure what scipy is doing exactly, but I can look into that later today to make sure that the solutions in the script are equal.
I'll add that to the docs. Do you have specific interest in using the intrinsic Euler representation?
Best,
Lars
0 1 year ago Reply
Thank you Lars, that makes sense. I hadn't noticed the difference of convention.
The intrinsic convention could indeed be useful as it is the default in ROS.
0 1 year ago Reply
Does your description also applie to Studio?
I tried entering the following end-effector orientation in Studio:
From the
it indeed looks likeJacobi.Frame
is minimized. But if I try to enter these values in Studio, the interface acts strangely (recomputing the angles under the hood, I'm guessing) whenever I type a digit in thex
input box, and the most sensible/stable values I can enter arec
, where x is neither positive nor minimized (in absolute).a=-3.1416, b=1.5705, c=0
1 1 year ago Reply
@Alban Laflaquiere: Yeah, we're going to refactor the rotation input in Studio, and also add quaternion input.
0 1 year ago Reply