wheel_legged/application/balance/estimator.h

25 lines
540 B
C++

//
// Created by SJQ on 2024/3/7.
//
#include "kalman_filter.h"
#include "bsp_dwt.h"
#ifndef WHEEL_LEGGED_ESTIMATOR_H
#define WHEEL_LEGGED_ESTIMATOR_H
class estimator {
public:
estimator(float process_noise, float measure_noise);
void get_result(float state[2]);
void update(float x,float x_dot,float ax);
private:
KalmanFilter_t EstimateKF_; //使用KF作为状态观测器
float Estimate_X_[2]; //观测器估计的状态量
uint32_t DWT_CNT_; //计时用
float dt_;
};
#endif //WHEEL_LEGGED_ESTIMATOR_H