-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathtestCircular.jl
More file actions
55 lines (35 loc) · 986 Bytes
/
testCircular.jl
File metadata and controls
55 lines (35 loc) · 986 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using IncrementalInference
using Test
##
@testset "test Circular" begin
##
fg = initfg()
getSolverParams(fg).useMsgLikelihoods = true
addVariable!.(fg, [Symbol("x$i") for i=0:4], Circular)
addFactor!(fg, [:x0], PriorCircular(Normal(0.0,0.1)))
map(i->addFactor!(fg, [Symbol("x$i"),Symbol("x$(i+1)")], CircularCircular(Normal(1.0, 0.1))), 0:3)
solveTree!(fg);
##
sppes = map(var -> calcMeanMaxSuggested(fg, getLabel(var), :default).suggested[1],
sortDFG(getVariables(fg), by=getLabel))
gt = rem2pi.(collect(0:4), RoundNearest)
@show sppes
@show gt
@test all(isapprox.(sppes, gt, atol=0.35))
# test packing converters also
d = "/tmp/caesar/random/testfg"
saveDFG(d,fg)
lfg = loadDFG(d)
##
Base.rm(d*".tar.gz")
# check loaded fg for all variable and factors
@test issetequal(ls(fg), ls(lfg))
@test issetequal(lsf(fg), lsf(lfg))
##
end
@testset "test canonical helix generator utility" begin
##
tmp = calcHelix_T(0, 3, 25, radius=5, xr_t=t->(1/3)*t)
##
end
#