support special linearize for constraints, which Jacobian could be augmented by Jacobian-from-Hessian parts for Lagrange multipliers in SQP
parent
63ff1b47c1
commit
c3e3b693e7
|
@ -315,10 +315,15 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO pass unwhitened + noise model to Gaussian factor
|
// TODO pass unwhitened + noise model to Gaussian factor
|
||||||
|
// For now, only linearized constrained factors have noise model at linear level!!!
|
||||||
noiseModel::Constrained::shared_ptr constrained =
|
noiseModel::Constrained::shared_ptr constrained =
|
||||||
boost::dynamic_pointer_cast<noiseModel::Constrained>(this->noiseModel_);
|
boost::dynamic_pointer_cast<noiseModel::Constrained>(this->noiseModel_);
|
||||||
if(constrained)
|
if(constrained) {
|
||||||
return GaussianFactor::shared_ptr(new JacobianFactor(terms, b, constrained->unit()));
|
size_t augmentedDim = terms[0].second.rows() - constrained->dim();
|
||||||
|
Vector augmentedZero = zero(augmentedDim);
|
||||||
|
Vector augmentedb = concatVectors(2, &b, &augmentedZero);
|
||||||
|
return GaussianFactor::shared_ptr(new JacobianFactor(terms, augmentedb, constrained->unit(augmentedDim)));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return GaussianFactor::shared_ptr(new JacobianFactor(terms, b));
|
return GaussianFactor::shared_ptr(new JacobianFactor(terms, b));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue