Skip to content

Commit 14d8cc7

Browse files
WIP-CI: test x 6
1 parent 1a488e7 commit 14d8cc7

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

tests/integration_tests/pybinds_tests/test_pybind_units.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -191,20 +191,20 @@ def test_DFRegistration_pure_rotation():
191191

192192
def make_assertions(df_transformation_result):
193193
assert df_transformation_result is not None, "DFRegistration should return a transformation matrix"
194-
assert df_transformation_result.transformation_matrix[0][2] < -0.9, "The rotation part of transformation matrix should be close to the transposed rotation matrix initially applied"
195-
assert df_transformation_result.transformation_matrix[1][1] > 0.9, "The rotation part of transformation matrix should be close to the transposed rotation matrix initially applied"
196-
assert df_transformation_result.transformation_matrix[2][0] > 0.9, "The rotation part of transformation matrix should be close to the transposed rotation matrix initially applied"
194+
assert abs(df_transformation_result.transformation_matrix[0][0] - 0.866) < 0.1, "The rotation part of transformation matrix should be close to the transposed rotation matrix initially applied"
195+
assert abs(df_transformation_result.transformation_matrix[0][1]) < 0.1, "The rotation part of transformation matrix should be close to the transposed rotation matrix initially applied"
196+
assert abs(df_transformation_result.transformation_matrix[0][2] + 0.5) < 0.1, "The rotation part of transformation matrix should be close to the transposed rotation matrix initially applied"
197197

198-
vertices = [[-1, -1, 0], [1, -1, 0], [1, 1, 0], [-1, 1, 0]]
198+
vertices = [[-2, -1, 0], [2, -1, 0], [2, 1, 0], [-2, 1, 0]]
199199
faces = [[0, 1, 2], [0, 2, 3]]
200200
mesh = dfb.dfb_geometry.DFMesh(vertices, faces, [], [], [])
201201
mesh2 = dfb.dfb_geometry.DFMesh(vertices, faces, [], [], [])
202202

203203
r = dfb.dfb_transformation.DFTransformation()
204-
r.transformation_matrix = [[0.0, 0.0, 1.0, 0.0],
204+
r.transformation_matrix = [[0.866, 0.0, 0.5, 0.0],
205205
[0.0, 1.0, 0.0, 0.0],
206-
[-1.0, 0.0, 0.0, 0.0],
207-
[0.0, 0.0, 0.0, 1.0]] # 90 degree rotation around y-axis
206+
[-0.5, 0.0, 0.866, 0.0],
207+
[0.0, 0.0, 0.0, 1.0]] # 30 degree rotation around y-axis
208208

209209
pc_1 = mesh.sample_points_uniformly(1000)
210210
pc_2 = mesh2.sample_points_uniformly(1000)
@@ -226,9 +226,9 @@ def test_DFRegistration_bunny(create_DFPointCloudBunny):
226226

227227
def make_assertions(df_transformation_result):
228228
assert df_transformation_result is not None, "DFRegistration should return a transformation matrix"
229-
assert abs(df_transformation_result.transformation_matrix[0][3] + 0.1) < 0.02, "The translation in x should be around 0.1"
230-
assert abs(df_transformation_result.transformation_matrix[1][3] + 0.2) < 0.02, "The translation in y should be around 0.2"
231-
assert abs(df_transformation_result.transformation_matrix[2][3] - 0.1) < 0.02, "The translation in z should be around -0.1"
229+
assert abs(df_transformation_result.transformation_matrix[0][3] + 0.05) < 0.02, "The translation in x should be around -0.05"
230+
assert abs(df_transformation_result.transformation_matrix[1][3] + 0.05) < 0.02, "The translation in y should be around -0.05"
231+
assert abs(df_transformation_result.transformation_matrix[2][3] - 0.05) < 0.02, "The translation in z should be around 0.05"
232232
assert df_transformation_result.transformation_matrix[0][0] > 0.9, "The rotation part of transformation matrix should be close to the transposed rotation matrix initially applied"
233233
assert df_transformation_result.transformation_matrix[1][2] > 0.9, "The rotation part of transformation matrix should be close to the transposed rotation matrix initially applied "
234234
assert df_transformation_result.transformation_matrix[2][1] < -0.9, "The rotation part of transformation matrix should be close to the transposed rotation matrix initially applied"
@@ -237,9 +237,9 @@ def make_assertions(df_transformation_result):
237237
pc_2 = create_DFPointCloudBunny
238238

239239
transform = dfb.dfb_transformation.DFTransformation()
240-
transform.transformation_matrix = [[1.0, 0.0, 0.0, 0.1],
241-
[0.0, 0.0, -1.0, 0.2],
242-
[0.0, 1.0, 0.0, -0.1],
240+
transform.transformation_matrix = [[1.0, 0.0, 0.0, 0.05],
241+
[0.0, 0.0, -1.0, 0.05],
242+
[0.0, 1.0, 0.0, -0.05],
243243
[0.0, 0.0, 0.0, 1.0]]
244244
pc_2.apply_transformation(transform)
245245

0 commit comments

Comments
 (0)