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
48 double orientationNoise = 0.1) {
49 setNoiseAutocorrelation(positionNoise, orientationNoise);
51 void setNoiseAutocorrelation(
double positionNoise = 0.01,
52 double orientationNoise = 0.1) {
63 return pose_externalized_rotation::stateTransitionMatrix(dt);
66 void predictState(State &s,
double dt) {
70 s.setErrorCovariance(Pminus);
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(
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 types::DimSquareMatrix< StateType > predictErrorCovariance(StateType const &state, ProcessModelType &processModel, double dt)
Computes P-.
Definition: FlexibleKalmanBase.h:135
StateVector computeEstimate(State &state, double dt) const
Returns a 12-element vector containing a predicted state based on a constant velocity process model...
Definition: PoseConstantVelocity.h:99
typename detail::Dimension_impl< T >::type Dimension
Given a state or measurement, get the dimension as a std::integral_constant.
Definition: FlexibleKalmanBase.h:87
A constant-velocity model for a 6DOF pose (with velocities)
Definition: PoseConstantVelocity.h:40
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
StateSquareMatrix getStateTransitionMatrix(State const &, double dt) const
Also known as the "process model jacobian" in TAG, this is A.
Definition: PoseConstantVelocity.h:61
StateVector const & stateVector() const
xhat
Definition: PoseState.h:177
StateSquareMatrix getSampledProcessNoiseCovariance(double dt) const
This is Q(deltaT) - the Sampled Process Noise Covariance.
Definition: PoseConstantVelocity.h:79
Definition: PoseState.h:164
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:127
void setStateVector(StateVector const &state)
set xhat
Definition: PoseState.h:175