From 74e5f78993f9eefc6a6861f478f68dd16c9a4f15 Mon Sep 17 00:00:00 2001 From: Miguel Oliveira Date: Sat, 4 May 2024 19:02:44 +0100 Subject: [PATCH] #942. Using the same average strategy for the translation error as in compareAtomTransforms --- atom_core/src/atom_core/transformations.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/atom_core/src/atom_core/transformations.py b/atom_core/src/atom_core/transformations.py index 1d2d3228..48310415 100644 --- a/atom_core/src/atom_core/transformations.py +++ b/atom_core/src/atom_core/transformations.py @@ -47,7 +47,7 @@ def compareTransforms(t1, t2): exit(0) # Method: We will use the following method. If T1 and T2 are the same, then multiplying one by the inverse of the other will produce and identity matrix, with zero translation and rotation. So we will do the multiplication and then evaluation the amount of rotation and translation in the resulting matrix. - # print('Comparing \nt1= ' + str(t1) + ' \n\nt2=' + str(t2)) + # print('Comparing \nt1=\n' + str(t1) + '\n\nt2=\n' + str(t2)) t_delta = np.dot(np.linalg.inv(t1), t2) # print('t_delta = ' + str(t_delta)) @@ -57,10 +57,9 @@ def compareTransforms(t1, t2): translation_delta = t_delta[0:3, 3] # print('translation_delta = ' + str(translation_delta)) - x, y, z = translation_delta # global metrics - translation_error = np.sqrt(x**2 + y**2 + z**2) + translation_error = float(abs(np.average(translation_delta))) rotation_error = float(np.average([abs(roll), abs(pitch), abs(yaw)])) # TODO How to compute aggregate rotation error? For now we use the average