半舵旗舰版(功率控制有更改)

This commit is contained in:
guoxy06
2026-07-26 11:27:00 +08:00
parent 2b18d60476
commit 63d4b7ae7d
8 changed files with 825 additions and 5 deletions

25
modules/algorithm/rls.h Normal file
View File

@@ -0,0 +1,25 @@
#ifndef RLS_H
#define RLS_H
#include <stdint.h>
#define RLS_MAX_ORDER 4u
typedef struct
{
uint8_t order;
uint8_t initialized;
float lambda;
float theta[RLS_MAX_ORDER];
float covariance[RLS_MAX_ORDER][RLS_MAX_ORDER];
float gain[RLS_MAX_ORDER];
float last_prediction;
float last_error;
} RLSInstance;
void RLSInit(RLSInstance *rls, uint8_t order, float lambda, float init_covariance, const float *initial_theta);
float RLSPredict(const RLSInstance *rls, const float *x);
float RLSUpdate(RLSInstance *rls, const float *x, float y);
const float *RLSGetTheta(const RLSInstance *rls);
#endif