Skip to content

Commit 1b74353

Browse files
committed
leverage hiding inside HybridGaussianFactor
1 parent 6b9fb5b commit 1b74353

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

gtsam/hybrid/HybridGaussianConditional.cpp

+3-8
Original file line numberDiff line numberDiff line change
@@ -229,15 +229,10 @@ std::shared_ptr<HybridGaussianFactor> HybridGaussianConditional::likelihood(
229229
if (Cgm_Kgcm == 0.0) {
230230
return {likelihood_m, 0.0};
231231
} else {
232-
// Add a constant factor to the likelihood in case the noise models
232+
// Add a constant to the likelihood in case the noise models
233233
// are not all equal.
234-
GaussianFactorGraph gfg;
235-
gfg.push_back(likelihood_m);
236-
Vector c(1);
237-
c << std::sqrt(2.0 * Cgm_Kgcm);
238-
auto constantFactor = std::make_shared<JacobianFactor>(c);
239-
gfg.push_back(constantFactor);
240-
return {std::make_shared<JacobianFactor>(gfg), 0.0};
234+
double c = 2.0 * Cgm_Kgcm;
235+
return {likelihood_m, c};
241236
}
242237
});
243238
return std::make_shared<HybridGaussianFactor>(

0 commit comments

Comments
 (0)