@@ -2,6 +2,7 @@ using DistributedFactorGraphs
2
2
using IncrementalInference
3
3
using LineSearches
4
4
using Manifolds
5
+ using LieGroups
5
6
using StaticArrays
6
7
using Test
7
8
@@ -12,10 +13,10 @@ using Test
12
13
# #
13
14
14
15
# @defVariable SpecialOrthogonal2 SpecialOrthogonal(2) @MMatrix([1.0 0.0; 0.0 1.0])
15
- @defVariable SpecialOrthogonal2 SpecialOrthogonal (2 ) SMatrix {2,2} (1.0 , 0.0 , 0.0 , 1.0 )
16
+ @defVariable SpecialOrthogonal2 SpecialOrthogonalGroup (2 ) SMatrix {2,2} (1.0 , 0.0 , 0.0 , 1.0 )
16
17
17
18
M = getManifold (SpecialOrthogonal2)
18
- @test M == SpecialOrthogonal (2 )
19
+ @test M == SpecialOrthogonalGroup (2 )
19
20
pT = getPointType (SpecialOrthogonal2)
20
21
# @test pT == MMatrix{2, 2, Float64, 4}
21
22
@test pT == SMatrix{2 ,2 ,Float64,4 }
@@ -28,7 +29,7 @@ fg = initfg()
28
29
29
30
v0 = addVariable! (fg, :x0 , SpecialOrthogonal2)
30
31
31
- mp = ManifoldPrior (SpecialOrthogonal (2 ), SA[1.0 0.0 ; 0.0 1.0 ], MvNormal ([0.01 ]))
32
+ mp = ManifoldPrior (SpecialOrthogonalGroup (2 ), SA[1.0 0.0 ; 0.0 1.0 ], MvNormal ([0.01 ]))
32
33
p = addFactor! (fg, [:x0 ], mp)
33
34
34
35
# #
@@ -43,7 +44,7 @@ vnd = getVariableState(fg, :x0, :default)
43
44
# #
44
45
45
46
v1 = addVariable! (fg, :x1 , SpecialOrthogonal2)
46
- mf = ManifoldFactor (SpecialOrthogonal (2 ), MvNormal ([pi ], [0.01 ]))
47
+ mf = ManifoldFactor (SpecialOrthogonalGroup (2 ), MvNormal ([pi ], [0.01 ]))
47
48
f = addFactor! (fg, [:x0 , :x1 ], mf)
48
49
49
50
doautoinit! (fg, :x1 )
@@ -60,18 +61,18 @@ solveTree!(fg) #; smtasks, verbose=true, recordcliqs=ls(fg))
60
61
end
61
62
62
63
63
- @testset " Test SpecialOrthogonal (3) prior" begin
64
+ @testset " Test SpecialOrthogonalGroup (3) prior" begin
64
65
65
66
# #
66
67
67
68
# Base.convert(::Type{<:Tuple}, M::SpecialOrthogonal{3}) = (:Euclid, :Euclid, :Euclid)
68
69
# Base.convert(::Type{<:Tuple}, ::IIF.InstanceType{SpecialOrthogonal{3}}) = (:Euclid, :Euclid, :Euclid)
69
70
70
- # @defVariable SO3 SpecialOrthogonal (3) @MMatrix([1.0 0.0; 0.0 1.0])
71
- @defVariable SO3 SpecialOrthogonal (3 ) SMatrix {3,3} (1.0 ,0.0 ,0.0 ,0.0 ,1.0 ,0.0 ,0.0 ,0.0 ,1.0 )
71
+ # @defVariable SO3 SpecialOrthogonalGroup (3) @MMatrix([1.0 0.0; 0.0 1.0])
72
+ @defVariable SO3 SpecialOrthogonalGroup (3 ) SMatrix {3,3} (1.0 ,0.0 ,0.0 ,0.0 ,1.0 ,0.0 ,0.0 ,0.0 ,1.0 )
72
73
73
74
M = getManifold (SO3)
74
- @test M == SpecialOrthogonal (3 )
75
+ @test M == SpecialOrthogonalGroup (3 )
75
76
pT = getPointType (SO3)
76
77
# @test pT == MMatrix{2, 2, Float64, 4}
77
78
@test pT == SMatrix{3 ,3 ,Float64,9 }
@@ -84,41 +85,41 @@ fg = initfg()
84
85
85
86
v0 = addVariable! (fg, :x0 , SO3)
86
87
87
- mp = ManifoldPrior (SpecialOrthogonal (3 ), SA[1.0 0.0 0.0 ; 0.0 1.0 0.0 ; 0.0 0.0 1.0 ], MvNormal ([0.01 , 0.01 , 0.01 ]))
88
+ mp = ManifoldPrior (SpecialOrthogonalGroup (3 ), SA[1.0 0.0 0.0 ; 0.0 1.0 0.0 ; 0.0 0.0 1.0 ], MvNormal ([0.01 , 0.01 , 0.01 ]))
88
89
p = addFactor! (fg, [:x0 ], mp)
89
90
90
91
doautoinit! (fg, :x0 )
91
92
92
93
vnd = getVariableState (fg, :x0 , :default )
93
- @test all (isapprox .( mean (SpecialOrthogonal (3 ),vnd. val), [1 0 0 ; 0 1 0 ; 0 0 1 ], atol= 0.01 ))
94
+ @test all (isapprox .( mean (SpecialOrthogonalGroup (3 ),vnd. val), [1 0 0 ; 0 1 0 ; 0 0 1 ], atol= 0.01 ))
94
95
@test all (is_point .(Ref (M), vnd. val))
95
96
96
97
points = sampleFactor (fg, :x0f1 , 100 )
97
- _M = SpecialOrthogonal (3 )
98
+ _M = SpecialOrthogonalGroup (3 )
98
99
std (_M, points .| > Matrix)
99
100
100
101
# #
101
102
102
103
v1 = addVariable! (fg, :x1 , SO3)
103
- mf = ManifoldFactor (SpecialOrthogonal (3 ), MvNormal ([0.01 ,0.01 ,0.01 ], [0.01 ,0.01 ,0.01 ]))
104
+ mf = ManifoldFactor (SpecialOrthogonalGroup (3 ), MvNormal ([0.01 ,0.01 ,0.01 ], [0.01 ,0.01 ,0.01 ]))
104
105
f = addFactor! (fg, [:x0 , :x1 ], mf)
105
106
106
107
doautoinit! (fg, :x1 )
107
108
108
109
vnd = getVariableState (fg, :x1 , :default )
109
- @test all (isapprox .( mean (SpecialOrthogonal (3 ),vnd. val), [0.9999 - 0.00995 0.01005 ; 0.01005 0.9999 - 0.00995 ; - 0.00995 0.01005 0.9999 ], atol= 0.01 ))
110
+ @test all (isapprox .( mean (SpecialOrthogonalGroup (3 ),vnd. val), [0.9999 - 0.00995 0.01005 ; 0.01005 0.9999 - 0.00995 ; - 0.00995 0.01005 0.9999 ], atol= 0.01 ))
110
111
@test all (is_point .(Ref (M), vnd. val))
111
112
112
113
# smtasks = Task[]
113
114
solveTree! (fg) # ; smtasks, verbose=true, recordcliqs=ls(fg))
114
115
115
116
# test them again after solve
116
117
vnd = getVariableState (fg, :x0 , :default )
117
- @test all (isapprox .( mean (SpecialOrthogonal (3 ),vnd. val), [1 0 0 ; 0 1 0 ; 0 0 1 ], atol= 0.01 ))
118
+ @test all (isapprox .( mean (SpecialOrthogonalGroup (3 ),vnd. val), [1 0 0 ; 0 1 0 ; 0 0 1 ], atol= 0.01 ))
118
119
@test all (is_point .(Ref (M), vnd. val))
119
120
120
121
vnd = getVariableState (fg, :x1 , :default )
121
- @test all (isapprox .( mean (SpecialOrthogonal (3 ),vnd. val), [0.9999 - 0.00995 0.01005 ; 0.01005 0.9999 - 0.00995 ; - 0.00995 0.01005 0.9999 ], atol= 0.01 ))
122
+ @test all (isapprox .( mean (SpecialOrthogonalGroup (3 ),vnd. val), [0.9999 - 0.00995 0.01005 ; 0.01005 0.9999 - 0.00995 ; - 0.00995 0.01005 0.9999 ], atol= 0.01 ))
122
123
@test all (is_point .(Ref (M), vnd. val))
123
124
124
125
# 23Q2 default HagerZhang fails with `AssertionError: isfinite(phi_c) && isfinite(dphi_c)`, using alternate LineSearch
0 commit comments