-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SE3 from Transformation Matrix #14
Comments
where you able to figure this out? |
I am using the following:
I don't know if it's differentiable (I don't need this atm so haven't checked), but it should be as long as the pytorch3d function used is (which I can't see any reason why it shouldn't be). |
from lietorch import SE3
from scipy.spatial.transform import Rotation
pose_mat = data['poses'] # [n, 4, 4]
quat = Rotation.from_matrix(pose_mat[:, :3, :3]).as_quat()
trans = pose_mat[:, :3, 3]
pose_data = np.concatenate((trans, quat), axis=-1)
T = SE3.InitFromVec(torch.tensor(pose_data))
error = (T.matrix() - torch.tensor(pose_mat)).sum()
print(error) tensor(-4.0434e-07, dtype=torch.float64) |
Hi, isn't the error about 4e-7 too large? If you also wondering like I did, here is what I found out, it turned out the SciPy Rotation class do orthogonalize the input rotation matrix when is not strictly orthogonal. And this is often the case as pose matrces has precision loss when saving and loading. |
Hi, I'm wondering if it's possible to initialize a SE3 instance from a 4x4 transformation matrix, instead of quaternion + translation. Thank you!
The text was updated successfully, but these errors were encountered: