Skip to content
Snippets Groups Projects
Commit 0df60e55 authored by Joan Vallvé Navarro's avatar Joan Vallvé Navarro
Browse files

simplified & fixed constriant_block_absolute

parent 54855703
No related branches found
No related tags found
1 merge request!243Constraint prior sensor params
......@@ -39,20 +39,12 @@ class ConstraintBlockAbsolute: public ConstraintAutodiff<ConstraintBlockAbsolute
template<typename T>
inline bool ConstraintBlockAbsolute::operator ()(const T* const _sb, T* _residuals) const
{
// states
Eigen::Matrix<T, 3, 1> sb(_sb);
// measurements
Eigen::Vector3s measured_state(getMeasurement().data() + 0);
// error
Eigen::Matrix<T, 3, 1> er;
er = measured_state.cast<T>() - sb;
// Maps
Eigen::Map<T, 3, 1> sb(_sb); // state
Eigen::Map<Eigen::Matrix<T, 3, 1>> res(_residuals); // residual
// residual
Eigen::Map<Eigen::Matrix<T, 3, 1>> res(_residuals);
res = getFeaturePtr()->getMeasurementSquareRootInformationUpper().cast<T>() * er;
res = getFeaturePtr()->getMeasurementSquareRootInformationUpper().cast<T>() * (getMeasurement().cast<T>() - sb);
return true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment