Skip to content

Commit

Permalink
fix python tests
Browse files Browse the repository at this point in the history
  • Loading branch information
varunagrawal committed Sep 15, 2024
1 parent 1b74353 commit 1c74da2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions python/gtsam/tests/test_HybridFactorGraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_create(self):
jf1 = JacobianFactor(X(0), np.eye(3), np.zeros((3, 1)), model)
jf2 = JacobianFactor(X(0), np.eye(3), np.ones((3, 1)), model)

gmf = HybridGaussianFactor([X(0)], dk, [jf1, jf2])
gmf = HybridGaussianFactor([X(0)], dk, [(jf1, 0), (jf2, 0)])

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

gmf = HybridGaussianFactor([X(0)], dk, [jf1, jf2])
gmf = HybridGaussianFactor([X(0)], dk, [(jf1, 0), (jf2, 0)])

hfg = HybridGaussianFactorGraph()
hfg.push_back(jf1)
Expand Down
13 changes: 6 additions & 7 deletions python/gtsam/tests/test_HybridNonlinearFactorGraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,12 @@ def test_nonlinear_hybrid(self):
nlfg.push_back(
PriorFactorPoint3(2, Point3(1, 2, 3),
noiseModel.Diagonal.Variances([0.5, 0.5, 0.5])))
nlfg.push_back(
gtsam.HybridNonlinearFactor([1], dk, [
PriorFactorPoint3(1, Point3(0, 0, 0),
noiseModel.Unit.Create(3)),
PriorFactorPoint3(1, Point3(1, 2, 1),
noiseModel.Unit.Create(3))
]))

factors = [(PriorFactorPoint3(1, Point3(0, 0, 0),
noiseModel.Unit.Create(3)), 0.0),
(PriorFactorPoint3(1, Point3(1, 2, 1),
noiseModel.Unit.Create(3)), 0.0)]
nlfg.push_back(gtsam.HybridNonlinearFactor([1], dk, factors))
nlfg.push_back(gtsam.DecisionTreeFactor((10, 2), "1 3"))
values = gtsam.Values()
values.insert_point3(1, Point3(0, 0, 0))
Expand Down

0 comments on commit 1c74da2

Please sign in to comment.