From 96c6989418726a9fcdcfe4a27e1f481b9e4ffa13 Mon Sep 17 00:00:00 2001 From: The visu3d Authors Date: Tue, 19 Nov 2024 04:16:47 -0800 Subject: [PATCH] Fix issue with matrix4x4 returning different type (float64) than the R, t in the transformation (float32). PiperOrigin-RevId: 697961266 --- visu3d/dc_arrays/transformation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/visu3d/dc_arrays/transformation.py b/visu3d/dc_arrays/transformation.py index d6881dc..c2e4ec1 100644 --- a/visu3d/dc_arrays/transformation.py +++ b/visu3d/dc_arrays/transformation.py @@ -302,7 +302,7 @@ def matrix4x4(self) -> FloatArray['*shape 4 4']: t = einops.rearrange(self.t, '... d -> ... d 1') matrix3x4 = self.xnp.concatenate([self.R, t], axis=-1) assert matrix3x4.shape == (3, 4) - last_row = self.xnp.asarray([[0, 0, 0, 1]]) + last_row = self.xnp.asarray([[0, 0, 0, 1]], dtype=self.R.dtype) return self.xnp.concatenate([matrix3x4, last_row], axis=-2) @property