Add matrix and kf code

This commit is contained in:
Milo Priegnitz
2024-05-24 17:32:02 +02:00
parent 78ed2e4eab
commit 290c48bfb1
10 changed files with 1013 additions and 2 deletions

View File

@@ -0,0 +1,38 @@
#ifndef KALMAN_FILTER_HPP
#define KALMAN_FILTER_HPP
#include <sta/math/linalg/matrix.hpp>
namespace math
{
struct KalmanState
{
matrix error;
matrix x;
};
class KalmanFilter
{
private:
matrix A_;
matrix B_;
matrix C_;
matrix Q_;
matrix R_;
uint8_t n_;
matrix identity_;
public:
KalmanFilter(matrix, matrix, matrix, matrix, matrix);
~KalmanFilter();
KalmanState predict(float, KalmanState, matrix);
KalmanState correct(float,KalmanState, matrix);
};
}
#endif // KALMAN_FILTER_HPP