Missed checks for empty noise model in GC and JF
parent
e846ed119c
commit
cd97f9866a
|
|
@ -140,7 +140,8 @@ namespace gtsam {
|
||||||
Vector soln = get_R().triangularView<Eigen::Upper>().solve(xS);
|
Vector soln = get_R().triangularView<Eigen::Upper>().solve(xS);
|
||||||
|
|
||||||
// Scale by sigmas
|
// Scale by sigmas
|
||||||
soln.array() *= model_->sigmas().array();
|
if(model_)
|
||||||
|
soln.array() *= model_->sigmas().array();
|
||||||
|
|
||||||
// Insert solution into a VectorValues
|
// Insert solution into a VectorValues
|
||||||
VectorValuesUnordered result;
|
VectorValuesUnordered result;
|
||||||
|
|
|
||||||
|
|
@ -442,21 +442,29 @@ namespace gtsam {
|
||||||
Matrix A(Ab_.range(0, size()));
|
Matrix A(Ab_.range(0, size()));
|
||||||
Vector b(getb());
|
Vector b(getb());
|
||||||
// divide in sigma so error is indeed 0.5*|Ax-b|
|
// divide in sigma so error is indeed 0.5*|Ax-b|
|
||||||
if (weight) model_->WhitenSystem(A,b);
|
if (weight && model_)
|
||||||
|
model_->WhitenSystem(A,b);
|
||||||
return make_pair(A, b);
|
return make_pair(A, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
Matrix JacobianFactorUnordered::augmentedJacobian(bool weight) const {
|
Matrix JacobianFactorUnordered::augmentedJacobian(bool weight) const {
|
||||||
if (weight) { Matrix Ab(Ab_.range(0,Ab_.nBlocks())); model_->WhitenInPlace(Ab); return Ab; }
|
if (weight && model_) {
|
||||||
else return Ab_.range(0, Ab_.nBlocks());
|
Matrix Ab(Ab_.range(0,Ab_.nBlocks()));
|
||||||
|
model_->WhitenInPlace(Ab);
|
||||||
|
return Ab;
|
||||||
|
} else {
|
||||||
|
return Ab_.range(0, Ab_.nBlocks());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
JacobianFactorUnordered JacobianFactorUnordered::whiten() const {
|
JacobianFactorUnordered JacobianFactorUnordered::whiten() const {
|
||||||
JacobianFactorUnordered result(*this);
|
JacobianFactorUnordered result(*this);
|
||||||
result.model_->WhitenInPlace(result.Ab_.matrix());
|
if(model_) {
|
||||||
result.model_ = noiseModel::Unit::Create(result.model_->dim());
|
result.model_->WhitenInPlace(result.Ab_.matrix());
|
||||||
|
result.model_ = noiseModel::Unit::Create(result.model_->dim());
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue