mirror of
https://gitee.com/dlmu-cone/half-steering-basic-framework
synced 2026-10-24 01:52:20 +08:00
半舵旗舰版(功率控制有更改)
This commit is contained in:
25
modules/algorithm/rls.h
Normal file
25
modules/algorithm/rls.h
Normal 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
|
||||
Reference in New Issue
Block a user