Resurgence (PY2022)
Codebase for the Husky Robotics 2021-2022 rover Resurgence
Loading...
Searching...
No Matches
KalmanFilterBase.h
1#pragma once
2
3#include "StateSpaceUtil.h"
4
5#include <Eigen/Core>
6
7namespace filters {
8
15template <int stateDim, int inputDim> class KalmanFilterBase {
16public:
17 KalmanFilterBase()
20
26 virtual void predict(const Eigen::Matrix<double, inputDim, 1>& input) = 0;
27
37
51
66
80 xHat = state;
81 P = estCovMat;
82 }
83
90 return xHat;
91 }
92
103
104protected:
107};
108
109} // namespace filters
static const ConstantReturnType Zero()
static const IdentityReturnType Identity()
Eigen::Matrix< double, stateDim, 1 > getState() const
Gets the current state estimate.
Definition KalmanFilterBase.h:89
void reset(const Eigen::Matrix< double, stateDim, 1 > &state, const Eigen::Matrix< double, stateDim, 1 > &stdDevs)
Reset the filter.
Definition KalmanFilterBase.h:62
void reset(const Eigen::Matrix< double, stateDim, 1 > &state)
Reset the filter.
Definition KalmanFilterBase.h:46
Eigen::Matrix< double, stateDim, stateDim > getEstimateCovarianceMat() const
Get the current estimate covariance matrix.
Definition KalmanFilterBase.h:100
void reset(const Eigen::Matrix< double, stateDim, 1 > &state, const Eigen::Matrix< double, stateDim, stateDim > &estCovMat)
Reset the filter.
Definition KalmanFilterBase.h:78
void reset()
Reset the filter.
Definition KalmanFilterBase.h:34
virtual void predict(const Eigen::Matrix< double, inputDim, 1 > &input)=0
Use the model to predict the next system state, given the current inputs.
Eigen::Matrix< double, size, size > createCovarianceMatrix(const Eigen::Matrix< double, size, 1 > &stdDevs)
Create a covariance matrix modelling independent variables with the given standard deviations.
Definition StateSpaceUtil.h:23