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(
13761376 return skew (w * theta )
13771377 else :
13781378 # 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 ))
13801382 st = math .sin (theta )
13811383 if st == 0 :
13821384 if twist :
Original file line number Diff line number Diff line change @@ -701,6 +701,18 @@ def test_functions_vect(self):
701701 # .T
702702 pass
703703
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+
704716# ============================== SE3 =====================================#
705717
706718class TestSE3 (unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments