Skip to content

Commit

Permalink
Merge pull request #1004 from JuliaRobotics/24Q1/test/fixapi
Browse files Browse the repository at this point in the history
restore test manikde eval many points api
  • Loading branch information
dehann authored Jan 25, 2024
2 parents 301d78a + 2aa0c61 commit 9f8bcee
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/ICRA2022_tests/nongaussian_mixture.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ solveGraph!(fg);


X2 = getBelief(fg, :x2)
@test isapprox( X2([-50:0.1:0;])*0.1 |> sum, 0 ; atol=0.1 )
@test isapprox( X2([0:0.1:40;])*0.1 |> sum, 0.4; atol=0.2 ) # 40% case
@test isapprox( X2([40:0.1:80;])*0.1 |> sum, 0.6; atol=0.2 ) # 60% case
@test isapprox( sum((s->X2([s;])).([-50:0.1:0;])*0.1)[1], 0 ; atol=0.1 )
@test isapprox( sum((s->X2([s;])).([0:0.1:40;])*0.1)[1], 0.4; atol=0.2 ) # 40% case
@test isapprox( sum((s->X2([s;])).([40:0.1:80;])*0.1)[1], 0.6; atol=0.2 ) # 60% case

# plotBelief(fg, [:x0, :x1, :x2])

Expand All @@ -75,14 +75,14 @@ solveGraph!(fg);


X2 = getBelief(fg, :x2)
@test isapprox( X2([-50:0.1:0;])*0.1 |> sum, 0 ; atol=0.1 )
@test isapprox( X2([0:0.1:40;])*0.1 |> sum, 0.4; atol=0.2 ) # 40% case
@test isapprox( X2([40:0.1:80;])*0.1 |> sum, 0.6; atol=0.2 ) # 60% case
@test isapprox( sum((s->X2([s;])).([-50:0.1:0;])*0.1)[1], 0 ; atol=0.1 )
@test isapprox( sum((s->X2([s;])).([0:0.1:40;])*0.1)[1], 0.4; atol=0.2 ) # 40% case
@test isapprox( sum((s->X2([s;])).([40:0.1:80;])*0.1)[1], 0.6; atol=0.2 ) # 60% case

X3 = getBelief(fg, :x3)
@test isapprox( X3([-100:0.1:-50;])*0.1 |> sum, 0 ; atol=0.1 )
@test isapprox( X3([-50:0.1:-20;] )*0.1 |> sum, 0.4; atol=0.2 ) # 40% case
@test isapprox( X3([-10:0.1:30;] )*0.1 |> sum, 0.6; atol=0.2 ) # 60% case
@test isapprox( sum((s->X3([s;])).([-100:0.1:-50;])*0.1)[1], 0 ; atol=0.1 )
@test isapprox( sum((s->X3([s;])).([-50:0.1:-20;] )*0.1)[1], 0.4; atol=0.2 ) # 40% case
@test isapprox( sum((s->X3([s;])).([-10:0.1:30;] )*0.1)[1], 0.6; atol=0.2 ) # 60% case


addFactor!(fg, [:x3, :x0], LinearRelative(Normal(30, 1)))
Expand Down

0 comments on commit 9f8bcee

Please sign in to comment.