@@ -57,15 +57,16 @@ inline HybridGaussianFactorGraph::shared_ptr makeSwitchingChain(
57
57
58
58
// keyFunc(1) to keyFunc(n+1)
59
59
for (size_t t = 1 ; t < n; t++) {
60
- std::vector<GaussianFactorValuePair> components = {
61
- {std::make_shared<JacobianFactor>(keyFunc (t), I_3x3, keyFunc (t + 1 ),
62
- I_3x3, Z_3x1),
63
- 0.0 },
64
- {std::make_shared<JacobianFactor>(keyFunc (t), I_3x3, keyFunc (t + 1 ),
65
- I_3x3, Vector3::Ones ()),
66
- 0.0 }};
67
- hfg.add (HybridGaussianFactor ({keyFunc (t), keyFunc (t + 1 )},
68
- {{dKeyFunc (t), 2 }}, components));
60
+ DiscreteKeys dKeys{{dKeyFunc (t), 2 }};
61
+ HybridGaussianFactor::FactorValuePairs components (
62
+ dKeys, {{std::make_shared<JacobianFactor>(keyFunc (t), I_3x3,
63
+ keyFunc (t + 1 ), I_3x3, Z_3x1),
64
+ 0.0 },
65
+ {std::make_shared<JacobianFactor>(
66
+ keyFunc (t), I_3x3, keyFunc (t + 1 ), I_3x3, Vector3::Ones ()),
67
+ 0.0 }});
68
+ hfg.add (
69
+ HybridGaussianFactor ({keyFunc (t), keyFunc (t + 1 )}, dKeys, components));
69
70
70
71
if (t > 1 ) {
71
72
hfg.add (DecisionTreeFactor ({{dKeyFunc (t - 1 ), 2 }, {dKeyFunc (t), 2 }},
0 commit comments