@@ -34,7 +34,8 @@ rs = [0, -pi/4, -pi/2, -3pi/4, -pi, 3pi/4, pi/2, pi/4, pi/4, -pi/4]
3434push!(rs, pi / 4 - atan(3 ,4 ))
3535
3636q = [5. , 5 ]
37- m = [pi / 4 ]
37+ SO2 = SpecialOrthogonal(2 )
38+ m = hat(SO2, getPointIdentity(SO2), [pi / 4 ])
3839
3940f = Pose2Point2Bearing(Normal(pi / 4 ,0.05 ))
4041
@@ -59,7 +60,9 @@ res = calcFactorResidualTemporary(f, (Pose2, Point2), [], (xi, xj))
5960f = Pose2Point2Bearing(Normal(pi ,0.001 ))
6061xi = ArrayPartition([0. ,0 ], [1. 0 ; 0 1 ])
6162xj = [- 1 , - 0.001 ]
62- res = calcFactorResidualTemporary(f, (Pose2, Point2), [pi ], (xi, xj))
63+
64+ m = hat(SO2, getPointIdentity(SO2), [pi ])
65+ res = calcFactorResidualTemporary(f, (Pose2, Point2), m, (xi, xj))
6366@test isapprox(res, [- 0.001 ], atol= 1e-3 )
6467
6568# #
@@ -200,9 +203,9 @@ lmp_noise = Matrix(Diagonal([0.01;0.01].^2))
200203fg = initfg()
201204
202205# landmarks
203- addVariable!(fg, :l1, Point2)
204- addVariable!(fg, :l2, Point2)
205- addVariable!(fg, :l3, Point2)
206+ addVariable!(fg, :l1, RoME . Point2)
207+ addVariable!(fg, :l2, RoME . Point2)
208+ addVariable!(fg, :l3, RoME . Point2)
206209
207210addFactor!(fg, [:l1], PriorPoint2(MvNormal([- 10.0 ;1.0 - 10.0 ],lmp_noise)), graphinit= false )
208211addFactor!(fg, [:l2], PriorPoint2(MvNormal([- 10.0 + sqrt(3 )/ 2 ;- 0.5 - 10.0 ],lmp_noise)), graphinit= false )
0 commit comments