Skip to content

Commit 1c74da2

Browse files
committed
fix python tests
1 parent 1b74353 commit 1c74da2

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

python/gtsam/tests/test_HybridFactorGraph.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_create(self):
3737
jf1 = JacobianFactor(X(0), np.eye(3), np.zeros((3, 1)), model)
3838
jf2 = JacobianFactor(X(0), np.eye(3), np.ones((3, 1)), model)
3939

40-
gmf = HybridGaussianFactor([X(0)], dk, [jf1, jf2])
40+
gmf = HybridGaussianFactor([X(0)], dk, [(jf1, 0), (jf2, 0)])
4141

4242
hfg = HybridGaussianFactorGraph()
4343
hfg.push_back(jf1)
@@ -64,7 +64,7 @@ def test_optimize(self):
6464
jf1 = JacobianFactor(X(0), np.eye(3), np.zeros((3, 1)), model)
6565
jf2 = JacobianFactor(X(0), np.eye(3), np.ones((3, 1)), model)
6666

67-
gmf = HybridGaussianFactor([X(0)], dk, [jf1, jf2])
67+
gmf = HybridGaussianFactor([X(0)], dk, [(jf1, 0), (jf2, 0)])
6868

6969
hfg = HybridGaussianFactorGraph()
7070
hfg.push_back(jf1)

python/gtsam/tests/test_HybridNonlinearFactorGraph.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,12 @@ def test_nonlinear_hybrid(self):
3535
nlfg.push_back(
3636
PriorFactorPoint3(2, Point3(1, 2, 3),
3737
noiseModel.Diagonal.Variances([0.5, 0.5, 0.5])))
38-
nlfg.push_back(
39-
gtsam.HybridNonlinearFactor([1], dk, [
40-
PriorFactorPoint3(1, Point3(0, 0, 0),
41-
noiseModel.Unit.Create(3)),
42-
PriorFactorPoint3(1, Point3(1, 2, 1),
43-
noiseModel.Unit.Create(3))
44-
]))
38+
39+
factors = [(PriorFactorPoint3(1, Point3(0, 0, 0),
40+
noiseModel.Unit.Create(3)), 0.0),
41+
(PriorFactorPoint3(1, Point3(1, 2, 1),
42+
noiseModel.Unit.Create(3)), 0.0)]
43+
nlfg.push_back(gtsam.HybridNonlinearFactor([1], dk, factors))
4544
nlfg.push_back(gtsam.DecisionTreeFactor((10, 2), "1 3"))
4645
values = gtsam.Values()
4746
values.insert_point3(1, Point3(0, 0, 0))

0 commit comments

Comments
 (0)