25 #ifndef INCLUDED_OrientationConstantVelocity_h_GUID_72B09543_A2CC_458F_2973_7DFD0593F8CC
26 #define INCLUDED_OrientationConstantVelocity_h_GUID_72B09543_A2CC_458F_2973_7DFD0593F8CC
42 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
43 using State = orient_externalized_rotation::State;
44 using StateVector = orient_externalized_rotation::StateVector;
45 using StateSquareMatrix =
46 orient_externalized_rotation::StateSquareMatrix;
49 setNoiseAutocorrelation(orientationNoise);
51 void setNoiseAutocorrelation(
double orientationNoise = 0.1) {
54 void setNoiseAutocorrelation(NoiseAutocorrelation
const &noise) {
61 return orient_externalized_rotation::stateTransitionMatrix(dt);
64 void predictState(State &s,
double dt) {
67 s.setStateVector(xHatMinus);
68 s.setErrorCovariance(Pminus);
79 StateSquareMatrix cov = StateSquareMatrix::Zero();
80 auto dt3 = (dt * dt * dt) / 3;
81 auto dt2 = (dt * dt) / 2;
82 for (std::size_t xIndex = 0; xIndex < dim / 2; ++xIndex) {
83 auto xDotIndex = xIndex + dim / 2;
85 const auto mu = getMu(xDotIndex);
86 cov(xIndex, xIndex) = mu * dt3;
87 auto symmetric = mu * dt2;
88 cov(xIndex, xDotIndex) = symmetric;
89 cov(xDotIndex, xIndex) = symmetric;
90 cov(xDotIndex, xDotIndex) = mu * dt;
98 OSVR_KALMAN_DEBUG_OUTPUT(
"Time change", dt);
99 StateVector ret = orient_externalized_rotation::applyVelocity(
100 state.stateVector(), dt);
107 NoiseAutocorrelation m_mu;
108 double getMu(std::size_t index)
const {
110 "Should only be passing "
111 "'i' - the main state, not "
123 #endif // INCLUDED_OrientationConstantVelocity_h_GUID_72B09543_A2CC_458F_2973_7DFD0593F8CC
Eigen::Matrix< Scalar, n, 1 > Vector
A vector of length n.
types::DimSquareMatrix< StateType > predictErrorCovariance(StateType const &state, ProcessModelType &processModel, double dt)
StateVector computeEstimate(State &state, double dt) const
typename detail::Dimension_impl< T >::type Dimension
The main namespace for all C++ elements of the framework, internal and external.
StateSquareMatrix getSampledProcessNoiseCovariance(double dt) const
StateSquareMatrix getStateTransitionMatrix(State const &, double dt) const
Also known as the "process model jacobian" in TAG, this is A.
A model for a 3DOF pose (with angular velocity)