|
31 | 31 | from dqrobotics.robot_modeling import DQ_SerialManipulatorDenso |
32 | 32 | from dqrobotics.robot_modeling import DQ_WholeBody |
33 | 33 | import numpy as np |
34 | | -from math import pi, sin , cos, sqrt |
| 34 | +from math import pi, sin, cos, sqrt, log10 |
35 | 35 |
|
36 | 36 |
|
37 | 37 | def numerical_differentiation(J, T): |
@@ -200,6 +200,11 @@ def compute_free_flying_robot_jacobian_derivatives(robot, iterations, T): |
200 | 200 | ####################################################################################### |
201 | 201 | free_flying_robot = DQ_FreeFlyingRobot() |
202 | 202 |
|
| 203 | + |
| 204 | + |
| 205 | +# Threshold related to DQ_threshold |
| 206 | +threshold = -log10(DQ_threshold) |
| 207 | + |
203 | 208 | ## DQTestCase class. |
204 | 209 | # This class performs the unit tests of the DQ_Kinematics::pose_jacobian_derivative class. |
205 | 210 | class DQTestCase(unittest.TestCase): |
@@ -252,10 +257,10 @@ def test_free_flying_robot_pose_jacobian_derivative(self): |
252 | 257 | J_dot, Numerical_J_dot_ = compute_free_flying_robot_jacobian_derivatives(free_flying_robot, iterations, 1e-4) |
253 | 258 | for i in range(0, iterations): |
254 | 259 | 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, |
256 | 261 | "Error in DQ_FreeFlyingRobot.pose_jacobian_derivative()") |
257 | 262 |
|
258 | | - |
| 263 | + |
259 | 264 | ########################################################################################################## |
260 | 265 | ########################################################################################################## |
261 | 266 | #### Testing classes where the pose jacobian derivative method is not available for the user |
|
0 commit comments