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 ...@@ -39,20 +39,12 @@ class ConstraintBlockAbsolute: public ConstraintAutodiff<ConstraintBlockAbsolute
template<typename T> template<typename T>
inline bool ConstraintBlockAbsolute::operator ()(const T* const _sb, T* _residuals) const inline bool ConstraintBlockAbsolute::operator ()(const T* const _sb, T* _residuals) const
{ {
// Maps
// states Eigen::Map<T, 3, 1> sb(_sb); // state
Eigen::Matrix<T, 3, 1> sb(_sb); Eigen::Map<Eigen::Matrix<T, 3, 1>> res(_residuals); // residual
// measurements
Eigen::Vector3s measured_state(getMeasurement().data() + 0);
// error
Eigen::Matrix<T, 3, 1> er;
er = measured_state.cast<T>() - sb;
// residual // residual
Eigen::Map<Eigen::Matrix<T, 3, 1>> res(_residuals); res = getFeaturePtr()->getMeasurementSquareRootInformationUpper().cast<T>() * (getMeasurement().cast<T>() - sb);
res = getFeaturePtr()->getMeasurementSquareRootInformationUpper().cast<T>() * er;
return true; 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