mirror of
https://gitee.com/dlmu-cone/bf_original_balance_chassis
synced 2026-07-24 11:37:45 +08:00
添加速度位置闭环分离和电机离线保护
This commit is contained in:
@@ -59,5 +59,13 @@ void SpeedEstimation(LinkNPodParam *lp, LinkNPodParam *rp, ChassisParam *cp, INS
|
||||
cp->vel_cov = (1 - k) * vel_cov; // 后验协方差
|
||||
|
||||
VAL_LIMIT(cp->vel_cov, 0.01, 100); // 协方差限幅
|
||||
cp->dist = cp->dist + cp->vel * delta_t;
|
||||
|
||||
// 速度和位置分离,有速度输入时不进行位置闭环
|
||||
if(abs(cp->target_v) < 0.001)
|
||||
{
|
||||
cp->target_dist = 0;
|
||||
cp->dist += cp->vel * delta_t;
|
||||
}
|
||||
else
|
||||
cp->target_dist = cp->dist = 0;
|
||||
}
|
||||
Reference in New Issue
Block a user