-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1299 from JuliaRobotics/21Q2/enh/vartypeInOptim
varType in _solveLambdaNumeric and translation and broken SE2 tests
- Loading branch information
Showing
4 changed files
with
76 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using DistributedFactorGraphs | ||
using IncrementalInference | ||
using Manifolds | ||
using StaticArrays | ||
using Test | ||
|
||
@testset "Test SpecialEuclidean(2)" begin | ||
|
||
Base.convert(::Type{<:Tuple}, M::SpecialEuclidean{2}) = (:Euclid, :Euclid, :Circular) | ||
Base.convert(::Type{<:Tuple}, ::IIF.InstanceType{SpecialEuclidean{2}}) = (:Euclid, :Euclid, :Circular) | ||
|
||
# @defVariable SpecialEuclidean2 SpecialEuclidean(2) ProductRepr(@MVector([0.0,0.0]), @MMatrix([1.0 0.0; 0.0 1.0])) | ||
@defVariable SpecialEuclidean2 SpecialEuclidean(2) ProductRepr([0.0,0.0], [1.0 0.0; 0.0 1.0]) | ||
|
||
M = getManifold(SpecialEuclidean2) | ||
@test M == SpecialEuclidean(2) | ||
pT = getPointType(SpecialEuclidean2) | ||
@test pT == ProductRepr{Tuple{Vector{Float64}, Matrix{Float64}}} | ||
# @test pT == ProductRepr{Tuple{MVector{2, Float64}, MMatrix{2, 2, Float64, 4}}} | ||
pϵ = getPointIdentity(SpecialEuclidean2) | ||
# @test_broken pϵ == ProductRepr(@MVector([0.0,0.0]), @MMatrix([1.0 0.0; 0.0 1.0])) | ||
@test_broken pϵ == ProductRepr([0.0,0.0], [1.0 0.0; 0.0 1.0]) | ||
|
||
@test is_point(getManifold(SpecialEuclidean2), getPointIdentity(SpecialEuclidean2)) | ||
|
||
## | ||
fg = initfg() | ||
|
||
v0 = addVariable!(fg, :x0, SpecialEuclidean2) | ||
|
||
# mp = ManifoldPrior(SpecialEuclidean(2), ProductRepr(@MVector([0.0,0.0]), @MMatrix([1.0 0.0; 0.0 1.0])), MvNormal([0.01, 0.01, 0.01])) | ||
mp = ManifoldPrior(SpecialEuclidean(2), ProductRepr(@MVector([0.0,0.0]), @MMatrix([1.0 0.0; 0.0 1.0])), MvNormal([0.01, 0.01, 0.01])) | ||
p = addFactor!(fg, [:x0], mp) | ||
|
||
@test_broken doautoinit!(fg, :x0) | ||
|
||
## | ||
vnd = getVariableSolverData(fg, :x0) | ||
@test all(isapprox.(mean(vnd.val), ProductRepr([0.0,0.0], [1.0 0.0; 0.0 1.0]), atol=0.1).parts) | ||
@test all(is_point.(Ref(M), vnd.val)) | ||
|
||
## | ||
v1 = addVariable!(fg, :x1, SpecialEuclidean2) | ||
mf = ManifoldFactor(SpecialEuclidean(2), MvNormal([pi], [0.01])) | ||
f = addFactor!(fg, [:x0, :x1], mf) | ||
|
||
@test_broken doautoinit!(fg, :x1) | ||
|
||
## | ||
smtasks = Task[] | ||
@test_broken solveTree!(fg; smtasks, verbose=true, recordcliqs=ls(fg)) | ||
# hists = fetchCliqHistoryAll!(smtasks); | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters