You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that mean() is fully broken on master. To reproduce this you'll have to checkout the fix/mean branch on my fork (will be merged after I write a test) and do the following.
julia> r=[RotZ(pi/2) for _ in 1:5000];
julia> mean(r)
ERROR: MethodError: RotZ{Float64}(::Quat{Float64}) is ambiguous. Candidates:
(::Type{RotZ{T}})(theta) where T in Rotations at /home/colinxs/workspace/Rotations.jl/src/euler_types.jl:17
(::Type{SA})(a::StaticArrays.StaticArray) where SA<:StaticArrays.StaticArray in StaticArrays at /home/colinxs/.julia/packages/StaticArrays/mcf7t/src/convert.jl:5
Possible fix, define
(::Type{RotZ{T}})(::StaticArrays.StaticArray)
Stacktrace:
[1] mean(::Array{RotZ{Float64},1}) at /home/colinxs/workspace/Rotations.jl/src/mean.jl:50
[2] top-level scope at none:0
julia> r2=[RotXY(0,pi/2) for _ in 1:5000];
julia> mean(r2)
ERROR: Cannot construct a two-axis rotation from a matrix
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] Type at /home/colinxs/workspace/Rotations.jl/src/euler_types.jl:232 [inlined]
[3] Type at /home/colinxs/.julia/packages/StaticArrays/mcf7t/src/convert.jl:5 [inlined]
[4] mean(::Array{RotXY{Float64},1}) at /home/colinxs/workspace/Rotations.jl/src/mean.jl:50
[5] top-level scope at none:0
julia> r3=[RotXYZ(0,0,pi/2) for _ in 1:5000];
julia> mean(r3)
3×3 RotXYZ{Float64}(3.14159, 0.0, 3.14159):
-1.0 -1.22465e-16 0.0
-1.22465e-16 1.0 -1.22465e-16
1.49976e-32 -1.22465e-16 -1.0
The text was updated successfully, but these errors were encountered:
I'm also wondering if mean should just do the AbstractArray thing (not return a rotation) and we should have some other function for mean rotations (or closest orthogonal matrix or whatever)?
Note that mean() is fully broken on master. To reproduce this you'll have to checkout the
fix/mean
branch on my fork (will be merged after I write a test) and do the following.The text was updated successfully, but these errors were encountered: