File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -1376,7 +1376,9 @@ def trlog(
1376
1376
return skew (w * theta )
1377
1377
else :
1378
1378
# general case
1379
- theta = math .acos ((np .trace (R ) - 1 ) / 2 )
1379
+ tr = (np .trace (R ) - 1 ) / 2
1380
+ # min for inaccuracies near identity yielding trace > 3
1381
+ theta = math .acos (min (tr , 1.0 ))
1380
1382
st = math .sin (theta )
1381
1383
if st == 0 :
1382
1384
if twist :
Original file line number Diff line number Diff line change @@ -701,6 +701,18 @@ def test_functions_vect(self):
701
701
# .T
702
702
pass
703
703
704
+ def test_functions_lie (self ):
705
+ R = SO3 .EulerVec ([0.42 , 0.73 , - 1.17 ])
706
+
707
+ # Check log and exponential map
708
+ nt .assert_equal (R , SO3 .Exp (R .log ()))
709
+ np .testing .assert_equal ((R .inv () * R ).log (), np .zeros ([3 , 3 ]))
710
+
711
+ # Check euler vector map
712
+ nt .assert_equal (R , SO3 .EulerVec (R .eulervec ()))
713
+ np .testing .assert_equal ((R .inv () * R ).eulervec (), np .zeros (3 ))
714
+
715
+
704
716
# ============================== SE3 =====================================#
705
717
706
718
class TestSE3 (unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments