25 #ifndef INCLUDED_FlexibleKalmanFilter_h_GUID_3A3B8A14_6DFC_4A81_97CA_189834AC4B61 26 #define INCLUDED_FlexibleKalmanFilter_h_GUID_3A3B8A14_6DFC_4A81_97CA_189834AC4B61 41 template <
typename StateType,
typename ProcessModelType>
43 processModel.predictState(state, dt);
44 OSVR_KALMAN_DEBUG_OUTPUT(
"Predicted state",
45 state.stateVector().transpose());
47 OSVR_KALMAN_DEBUG_OUTPUT(
"Predicted error covariance",
48 state.errorCovariance());
57 typename MeasurementType>
58 inline bool correct(StateType &state, ProcessModelType &processModel,
59 MeasurementType &meas,
bool cancelIfNotFinite =
true) {
62 if (cancelIfNotFinite && !inProgress.stateCorrectionFinite) {
66 return inProgress.finishCorrection(cancelIfNotFinite);
73 typename StateType =
typename ProcessModelType::State>
78 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
86 : m_processModel(), m_state(state) {}
91 : m_processModel(), m_state(state) {}
96 : m_processModel(processModel), m_state(state) {}
100 : m_processModel(processModel), m_state(state) {}
102 void predict(
double dt) {
103 kalman::predict(state(), processModel(), dt);
106 template <
typename MeasurementType>
107 void correct(MeasurementType &meas) {
111 ProcessModel &processModel() {
return m_processModel; }
112 ProcessModel
const &processModel()
const {
return m_processModel; }
114 State &state() {
return m_state; }
115 State
const &state()
const {
return m_state; }
118 ProcessModel m_processModel;
125 #endif // INCLUDED_FlexibleKalmanFilter_h_GUID_3A3B8A14_6DFC_4A81_97CA_189834AC4B61 typename FilterType::State StateType
Given a filter type, get the state type.
Definition: FlexibleKalmanBase.h:91
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
FlexibleKalmanFilter(State const &state)
Copy initialization from just state - depends on default-initializable process model.
Definition: FlexibleKalmanFilter.h:85
FlexibleKalmanFilter(ProcessModel const &processModel, State const &state)
copy initialization
Definition: FlexibleKalmanFilter.h:94
FlexibleKalmanFilter(State &&state)
Move initialization from just state - depends on default-initializable process model.
Definition: FlexibleKalmanFilter.h:90
typename FilterType::ProcessModel ProcessModelType
Given a filter type, get the process model type.
Definition: FlexibleKalmanBase.h:95
CorrectionInProgress< StateType, MeasurementType > beginCorrection(StateType &state, ProcessModelType &processModel, MeasurementType &meas)
Definition: FlexibleKalmanCorrect.h:135
FlexibleKalmanFilter(ProcessModel &&processModel, State &&state)
move initialization.
Definition: FlexibleKalmanFilter.h:99
EIGEN_MAKE_ALIGNED_OPERATOR_NEW FlexibleKalmanFilter()
Default initialization - depends on default-initializable process model and state.
Definition: FlexibleKalmanFilter.h:81
bool correct(StateType &state, ProcessModelType &processModel, MeasurementType &meas, bool cancelIfNotFinite=true)
Definition: FlexibleKalmanFilter.h:58
The main class implementing the common components of the Kalman family of filters.
Definition: FlexibleKalmanFilter.h:74