While creating a calibration, I found that the zero-function of rosys.geometry.Rotation uses integers, which causes cv2.Rodrigues to fail, because it expects floats.
While using .astype(np.float32) helps, using floats directly makes it easier to use in the future.
import cv2
import numpy as np
from rosys.geometry import Pose3d, Rotation
# works
extrinsics = Pose3d(x=0, y=0, z=0, rotation=Rotation(R=[[0, 0, 0], [0, 1, 0], [0, 0, 1]]))
R = extrinsics.rotation.matrix.astype(np.float32)
Rod = cv2.Rodrigues(R.T)[0]
# works
extrinsics = Pose3d(x=0.0, y=0.0, z=0.0, rotation=Rotation(R=[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]))
R = extrinsics.rotation.matrix
Rod = cv2.Rodrigues(R.T)[0]
# doesn't work without the changes
extrinsics = Pose3d(x=0, y=0, z=0, rotation=Rotation(R=[[0, 0, 0], [0, 1, 0], [0, 0, 1]]))
R = extrinsics.rotation.matrix
Rod = cv2.Rodrigues(R.T)[0]
While creating a calibration, I found that the zero-function of rosys.geometry.Rotation uses integers, which causes
cv2.Rodrigues
to fail, because it expects floats. While using.astype(np.float32)
helps, using floats directly makes it easier to use in the future.edit: float64 is needed for our tests