25 #ifndef INCLUDED_PoseConstantVelocity_h_GUID_BC2C6525_D7E6_4BB2_0220_9D6065795E12
26 #define INCLUDED_PoseConstantVelocity_h_GUID_BC2C6525_D7E6_4BB2_0220_9D6065795E12
42 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
43 using State = pose_externalized_rotation::State;
44 using StateVector = pose_externalized_rotation::StateVector;
45 using StateSquareMatrix = pose_externalized_rotation::StateSquareMatrix;
48 double orientationNoise = 0.1) {
49 setNoiseAutocorrelation(positionNoise, orientationNoise);
51 void setNoiseAutocorrelation(
double positionNoise = 0.01,
52 double orientationNoise = 0.1) {
56 void setNoiseAutocorrelation(NoiseAutocorrelation
const &noise) {
63 return pose_externalized_rotation::stateTransitionMatrix(dt);
66 void predictState(State &s,
double dt) {
69 s.setStateVector(xHatMinus);
70 s.setErrorCovariance(Pminus);
81 StateSquareMatrix cov = StateSquareMatrix::Zero();
82 auto dt3 = (dt * dt * dt) / 3;
83 auto dt2 = (dt * dt) / 2;
84 for (std::size_t xIndex = 0; xIndex < dim / 2; ++xIndex) {
85 auto xDotIndex = xIndex + dim / 2;
87 const auto mu = getMu(xIndex);
88 cov(xIndex, xIndex) = mu * dt3;
89 auto symmetric = mu * dt2;
90 cov(xIndex, xDotIndex) = symmetric;
91 cov(xDotIndex, xIndex) = symmetric;
92 cov(xDotIndex, xDotIndex) = mu * dt;
100 OSVR_KALMAN_DEBUG_OUTPUT(
"Time change", dt);
101 StateVector ret = pose_externalized_rotation::applyVelocity(
102 state.stateVector(), dt);
110 NoiseAutocorrelation m_mu;
111 double getMu(std::size_t index)
const {
113 "Should only be passing "
114 "'i' - the main state, not "
126 #endif // INCLUDED_PoseConstantVelocity_h_GUID_BC2C6525_D7E6_4BB2_0220_9D6065795E12
Eigen::Matrix< Scalar, n, 1 > Vector
A vector of length n.
StateSquareMatrix getSampledProcessNoiseCovariance(double dt) const
types::DimSquareMatrix< StateType > predictErrorCovariance(StateType const &state, ProcessModelType &processModel, double dt)
typename detail::Dimension_impl< T >::type Dimension
A constant-velocity model for a 6DOF pose (with velocities)
The main namespace for all C++ elements of the framework, internal and external.
StateVector computeEstimate(State &state, double dt) const
StateSquareMatrix getStateTransitionMatrix(State const &, double dt) const
Also known as the "process model jacobian" in TAG, this is A.