-
Notifications
You must be signed in to change notification settings - Fork 13
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 #390 from JuliaRobotics/bugfix/21Q1/backport_fixPo…
…se2Point2 Backport: Fix and test Pose2Point2
- Loading branch information
Showing
4 changed files
with
29 additions
and
3 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
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,25 @@ | ||
using RoME | ||
using Test | ||
using Statistics | ||
|
||
## MWE Pose2Point2 from #388 | ||
@testset "basic Pose2Point2 test" begin | ||
|
||
fg = initfg() | ||
|
||
addVariable!(fg, :x1, Pose2) | ||
addVariable!(fg, :l1, Point2) | ||
|
||
addFactor!(fg, [:x1], PriorPose2(MvNormal([0.,0, 0], [0.01, 0.01, 0.01]))) | ||
|
||
addFactor!(fg, [:x1; :l1], Pose2Point2(MvNormal([0.0,-1], [0.1,0.1]))) | ||
|
||
ensureAllInitialized!(fg) | ||
|
||
tree, smt, hist = solveTree!(fg) | ||
|
||
@test isapprox(mean(getVal(fg, :x1),dims=2), [0,0,0], atol = 0.05) | ||
@test isapprox(mean(getVal(fg, :l1),dims=2), [0,-1], atol = 0.05) | ||
end | ||
|
||
|