diff --git a/src/constraint_block_absolute.h b/src/constraint_block_absolute.h index af4a5bdf5b50fa6785a60ee1a870be2cb7f561e1..737de58a81d0625dd9e31c877d2f227110076519 100644 --- a/src/constraint_block_absolute.h +++ b/src/constraint_block_absolute.h @@ -22,10 +22,8 @@ class ConstraintBlockAbsolute: public ConstraintAutodiff<ConstraintBlockAbsolute { public: - ConstraintBlockAbsolute(StateBlockPtr _sb_ptr, const Eigen::VectorXs& _state, const Eigen::MatrixXs& _cov, bool _apply_loss_function = false, ConstraintStatus _status = CTR_ACTIVE) : - ConstraintAutodiff<ConstraintBlockAbsolute,3,3>(CTR_BLOCK_ABS, nullptr, nullptr, nullptr, nullptr, nullptr, _apply_loss_function, _status, _sb_ptr), - state_(_state), - cov_(_cov) + ConstraintBlockAbsolute(StateBlockPtr _sb_ptr, bool _apply_loss_function = false, ConstraintStatus _status = CTR_ACTIVE) : + ConstraintAutodiff<ConstraintBlockAbsolute,3,3>(CTR_BLOCK_ABS, nullptr, nullptr, nullptr, nullptr, nullptr, _apply_loss_function, _status, _sb_ptr) { setType("FIX SB"); } @@ -40,10 +38,6 @@ class ConstraintBlockAbsolute: public ConstraintAutodiff<ConstraintBlockAbsolute return JAC_AUTO; } - private: - const Eigen::VectorXs state_; - const Eigen::MatrixXs cov_; - }; template<typename T> @@ -54,7 +48,7 @@ inline bool ConstraintBlockAbsolute::operator ()(const T* const _sb, T* _residua Eigen::Matrix<T, 3, 1> sb(_sb); // measurements - Eigen::Vector3s measured_state(state_.data() + 0); + Eigen::Vector3s measured_state(getMeasurement().data() + 0); // error Eigen::Matrix<T, 3, 1> er;