Skip to content

Commit 6f4deae

Browse files
committed
[DQ_Kinematics_test.py] Defined the threshold using DQ.threshold.
1 parent 8a2a396 commit 6f4deae

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

DQ_Kinematics_test.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
from dqrobotics.robot_modeling import DQ_FreeFlyingRobot
3131
from dqrobotics import *
3232
from DQ_test_facilities import *
33-
33+
import math
3434
# The data from MATLAB
3535
mat = scipy.io.loadmat('DQ_Kinematics_test_16_05_2023.mat')
3636
# A list of random DQs
@@ -47,10 +47,11 @@
4747
plane_jacobian_list = get_list_of_matrices_from_mat('result_of_plane_jacobian', mat)
4848
# The DQ_SerialManipulator used to calculate everything for DQ_Kinematics as well
4949
serial_manipulator_robot = KukaLw4Robot.kinematics()
50-
51-
50+
# The DQ_FreeFlyingRobot
5251
free_flying_robot = DQ_FreeFlyingRobot()
5352

53+
54+
threshold = -math.log10(DQ_threshold)
5455
class DQTestCase(unittest.TestCase):
5556
global mat
5657
global h_list
@@ -104,7 +105,7 @@ def test_free_flying_robot_fkm(self):
104105
def test_free_flying_robot_pose_jacobian(self):
105106
free_flying_pose_jacobian_list = get_list_of_matrices_from_mat('result_of_free_flying_robot_pose_jacobian', mat)
106107
for q, J in zip(h_list, free_flying_pose_jacobian_list):
107-
numpy.testing.assert_almost_equal(free_flying_robot.pose_jacobian(q), J, 12, "Error in DQ_FreeFlyingRobot.pose_jacobian")
108+
numpy.testing.assert_almost_equal(free_flying_robot.pose_jacobian(q), J, threshold, "Error in DQ_FreeFlyingRobot.pose_jacobian")
108109

109110
def test_distance_jacobian(self):
110111
distance_jacobian_list = get_list_of_matrices_from_mat('result_of_distance_jacobian', mat)

0 commit comments

Comments
 (0)