wheel_legged/application/balance/estimator.h

21 lines
542 B
C
Raw Normal View History

2024-03-09 15:53:34 +08:00
//
// 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
2024-03-17 17:51:24 +08:00
typedef struct
{
2024-03-09 15:53:34 +08:00
KalmanFilter_t EstimateKF_; //使用KF作为状态观测器
float Estimate_X_[2]; //观测器估计的状态量
uint32_t DWT_CNT_; //计时用
float dt_;
2024-03-17 17:51:24 +08:00
}estimator_t;
2024-03-09 15:53:34 +08:00
2024-03-17 17:51:24 +08:00
void estimator_init(estimator_t *est ,float process_noise, float measure_noise);
void estimator_update(estimator_t *est ,float x,float x_dot,float ax);
2024-03-09 15:53:34 +08:00
#endif //WHEEL_LEGGED_ESTIMATOR_H