25 #ifndef INCLUDED_FlexibleKalmanBase_h_GUID_E4CC84A0_1B4F_4389_95ED_9C37F5FEE95D
26 #define INCLUDED_FlexibleKalmanBase_h_GUID_E4CC84A0_1B4F_4389_95ED_9C37F5FEE95D
35 #include <type_traits>
37 #ifndef OSVR_KALMAN_DEBUG_OUTPUT
38 #define OSVR_KALMAN_DEBUG_OUTPUT(Name, Value)
54 template <DimensionType n>
57 struct HasDimensionBase {};
62 template <types::DimensionType DIM>
69 template <
typename T,
typename =
void>
struct Dimension_impl {
70 using type = DimensionConstant<T::DIMENSION>;
73 template <DimensionType n>
75 using type = DimensionConstant<n>;
79 struct Dimension_impl<T, typename
std::enable_if<std::is_base_of<
80 HasDimensionBase, T>::value>::type> {
87 using Dimension =
typename detail::Dimension_impl<T>::type;
90 template <
typename FilterType>
94 template <
typename FilterType>
98 template <DimensionType n>
using Vector = Eigen::Matrix<Scalar, n, 1>;
104 template <DimensionType n>
108 template <
typename T>
112 template <DimensionType n>
116 template <
typename T>
120 template <DimensionType m, DimensionType n>
121 using Matrix = Eigen::Matrix<Scalar, m, n>;
124 template <
typename T,
typename U>
133 template <
typename StateType,
typename ProcessModelType>
138 processModel.getStateTransitionMatrix(state, dt);
145 OSVR_KALMAN_DEBUG_OUTPUT(
146 "Process Noise Covariance Q",
147 processModel.getSampledProcessNoiseCovariance(dt));
148 return A * P * A.transpose() +
149 processModel.getSampledProcessNoiseCovariance(dt);
155 #endif // INCLUDED_FlexibleKalmanBase_h_GUID_E4CC84A0_1B4F_4389_95ED_9C37F5FEE95D
Eigen::Matrix< Scalar, n, 1 > Vector
A vector of length n.
types::DimSquareMatrix< StateType > predictErrorCovariance(StateType const &state, ProcessModelType &processModel, double dt)
typename FilterType::State StateType
Given a filter type, get the state type.
std::integral_constant< DimensionType, n > DimensionConstant
Type constant for dimensions.
typename detail::Dimension_impl< T >::type Dimension
Eigen::Matrix< Scalar, n, n > SquareMatrix
A square matrix, n x n.
The main namespace for all C++ elements of the framework, internal and external.
Vector< Dimension< T >::value > DimVector
A vector of length = dimension of T.
Header wrapping include of and for warning quieting.
typename FilterType::ProcessModel ProcessModelType
Given a filter type, get the process model type.
SquareMatrix< Dimension< T >::value > DimSquareMatrix
A square matrix, n x n, where n is the dimension of T.
Matrix< Dimension< T >::value, Dimension< U >::value > DimMatrix
A matrix with rows = dimension of T, cols = dimension of U.
Eigen::DiagonalMatrix< Scalar, n > DiagonalMatrix
A square diagonal matrix, n x n.
std::size_t DimensionType
Type for dimensions.
DiagonalMatrix< Dimension< T >::value > DimDiagonalMatrix
A square diagonal matrix, n x n, where n is the dimension of T.
double Scalar
Common scalar type.
Eigen::Matrix< Scalar, m, n > Matrix
A matrix with rows = m, cols = n.