Skip to content

Commit

Permalink
Merge pull request #18 from dehann/hotfix/tracetotr
Browse files Browse the repository at this point in the history
need trace as tr for jl 1.0
  • Loading branch information
dehann committed Oct 5, 2018
2 parents b6b4f47 + 3895664 commit e5c1100
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/TransformUtils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,8 @@ end

function logmap(grp::SO3)
R = grp.R
tr = trace(R)
if abs(tr+1.0) < 1e-10
tra = LinearAlgebra.tr(R)
if abs(tra+1.0) < 1e-10
if abs(R[3,3]+1.0) > 1e-10
ret = (pi / sqrt(2.0+2.0*R[3,3] )) * [R[1,3]; R[2,3]; (1.0+R[3,3])]
else
Expand All @@ -609,9 +609,9 @@ function logmap(grp::SO3)
end
end
else
tr_3 = tr-3.0
tr_3 = tra-3.0
if (tr_3<-1e-7)
theta = acos((tr-1.0)/2.0)
theta = acos((tra-1.0)/2.0)
magnitude = theta/(2.0*sin(theta))
else
magnitude = 0.5 - tr_3*tr_3/12.0
Expand Down
2 changes: 1 addition & 1 deletion test/testInPlaceConvert.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# profile/test conversion utils

using TransformUtils
using Base.Test
using Test
using BenchmarkTools, ProfileView

R = SO3(0)
Expand Down

0 comments on commit e5c1100

Please sign in to comment.