19 #ifndef MSF_CHECKFUZZYTRACKING_H_
20 #define MSF_CHECKFUZZYTRACKING_H_
26 template<
typename EKFState_T,
typename NONTEMPORALDRIFTINGTYPE>
40 Eigen::Matrix<double, nBuff_, qbuffRowsAtCompiletime>
qbuff_;
48 qbuff_ = Eigen::Matrix<double, nBuff_, qbuffRowsAtCompiletime>::Constant(0);
55 bool check(shared_ptr<EKFState_T> delaystate, EKFState_T& buffstate,
60 const bool isquaternion =
61 msf_tmp::isQuaternionType<
65 "Assumed that the non drifting state is a Quaternion, "
66 "which is not the case for the currently defined state vector. If you "
67 "want to use an euclidean state, please first adapt qbuff and the error "
68 "detection routines");
69 typedef typename EKFState_T::StateDefinition_T StateDefinition_T;
70 typedef typename EKFState_T::StateSequence_T StateSequence_T;
74 StateSequence_T>::value,
76 nErrorStatesAtCompileTime = EKFState_T::nErrorStatesAtCompileTime,
78 nStatesAtCompileTime = EKFState_T::nStatesAtCompileTime
84 Eigen::Quaternion<double> errq =
85 const_cast<const EKFState_T&
>(*delaystate)
86 .template get<indexOfStateWithoutTemporalDrift>().conjugate() *
87 Eigen::Quaternion<double>(
94 if (std::max(errq.vec().maxCoeff(), -errq.vec().minCoeff()) /
95 fabs(errq.w()) * 2 > fuzzythres)
98 std::max(errq.vec().maxCoeff(), -errq.vec().minCoeff()) /
99 fabs(errq.w())*2 <<
" limit: " << fuzzythres <<
"\n");
102 boost::fusion::for_each(
103 delaystate->statevars,
107 static_assert(static_cast<int>(
108 EKFState_T::nPropagatedCoreErrorStatesAtCompileTime) == 9,
109 "Assumed that nPropagatedCoreStates == 9, "
110 "which is not the case");
116 Eigen::Matrix<double, 1, 4>(const_cast<const EKFState_T&>(*delaystate).
117 template get<indexOfStateWithoutTemporalDrift>().coeffs());
124 Eigen::Matrix<double, 1, 4>(const_cast<const EKFState_T&>(*delaystate).
125 template get<indexOfStateWithoutTemporalDrift>().coeffs());
126 nontemporaldrifting_inittimer_++;
132 template<
typename EKFState_T>
145 #endif // MSF_CHECKFUZZYTRACKING_H_