mirror of
https://gitee.com/dlmu-cone/half-steering-basic-framework
synced 2026-10-23 17:42:20 +08:00
26 lines
623 B
C
26 lines
623 B
C
#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
|