1212model = pin .buildSampleModelHumanoid ()
1313rdata : pin .Data = model .createData ()
1414np .random .seed (0 )
15- FD_EPS = 1e-8
16- THRESH = 2 * FD_EPS ** 0.5
15+ EPS = 1e-7
16+ ATOL = 2 * EPS ** 0.5
1717
1818nq = model .nq
1919nv = model .nv
@@ -55,7 +55,7 @@ def test_com_placement():
5555 assert J .shape == realJ .shape
5656 assert np .allclose (fdata .Jx [:, :nv ], realJ )
5757
58- fun_fd = aligator .FiniteDifferenceHelper (space , fun , FD_EPS )
58+ fun_fd = aligator .FiniteDifferenceHelper (space , fun , EPS )
5959 fdata2 = fun_fd .createData ()
6060 fun_fd .evaluate (x0 , u0 , x0 , fdata2 )
6161 assert np .allclose (fdata .value , fdata2 .value )
@@ -70,7 +70,7 @@ def test_com_placement():
7070 fun .computeJacobians (x0 , u0 , x0 , fdata )
7171 fun_fd .evaluate (x0 , u0 , x0 , fdata2 )
7272 fun_fd .computeJacobians (x0 , u0 , x0 , fdata2 )
73- assert np .allclose (fdata .Jx , fdata2 .Jx , THRESH )
73+ assert np .allclose (fdata .Jx , fdata2 .Jx , ATOL )
7474
7575
7676def test_frame_velocity ():
@@ -94,7 +94,7 @@ def test_frame_velocity():
9494
9595 fun .computeJacobians (x0 , fdata )
9696
97- fun_fd = aligator .FiniteDifferenceHelper (space , fun , FD_EPS )
97+ fun_fd = aligator .FiniteDifferenceHelper (space , fun , EPS )
9898 fdata2 = fun_fd .createData ()
9999 fun_fd .evaluate (x0 , u0 , x0 , fdata2 )
100100 fun_fd .computeJacobians (x0 , u0 , x0 , fdata2 )
@@ -110,7 +110,7 @@ def test_frame_velocity():
110110 print (fdata .Jx )
111111 print (fdata2 .Jx )
112112 print (fdata .Jx )
113- assert np .allclose (fdata .Jx , fdata2 .Jx , THRESH )
113+ assert np .allclose (fdata .Jx , fdata2 .Jx , ATOL )
114114
115115
116116if __name__ == "__main__" :
0 commit comments