Skip to content

Commit 8a2a396

Browse files
committed
[DQ_Kinematics_pose_jacobian_derivative_test.py] Defined the threshold using DQ.threshold.
1 parent ae0b53a commit 8a2a396

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

DQ_Kinematics_pose_jacobian_derivative_tests.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
from dqrobotics.robot_modeling import DQ_SerialManipulatorDenso
3232
from dqrobotics.robot_modeling import DQ_WholeBody
3333
import numpy as np
34-
from math import pi, sin , cos, sqrt
34+
from math import pi, sin, cos, sqrt, log10
3535

3636

3737
def numerical_differentiation(J, T):
@@ -200,6 +200,11 @@ def compute_free_flying_robot_jacobian_derivatives(robot, iterations, T):
200200
#######################################################################################
201201
free_flying_robot = DQ_FreeFlyingRobot()
202202

203+
204+
205+
# Threshold related to DQ_threshold
206+
threshold = -log10(DQ_threshold)
207+
203208
## DQTestCase class.
204209
# This class performs the unit tests of the DQ_Kinematics::pose_jacobian_derivative class.
205210
class DQTestCase(unittest.TestCase):
@@ -252,10 +257,10 @@ def test_free_flying_robot_pose_jacobian_derivative(self):
252257
J_dot, Numerical_J_dot_ = compute_free_flying_robot_jacobian_derivatives(free_flying_robot, iterations, 1e-4)
253258
for i in range(0, iterations):
254259
if (i > 4 and i < iterations - 4):
255-
np.testing.assert_almost_equal(J_dot[i, :, :], Numerical_J_dot_[i, :, :], 10,
260+
np.testing.assert_almost_equal(J_dot[i, :, :], Numerical_J_dot_[i, :, :], threshold,
256261
"Error in DQ_FreeFlyingRobot.pose_jacobian_derivative()")
257262

258-
263+
259264
##########################################################################################################
260265
##########################################################################################################
261266
#### Testing classes where the pose jacobian derivative method is not available for the user

0 commit comments

Comments
 (0)