初级会员

- 积分
- 198
- 金钱
- 198
- 注册时间
- 2018-7-8
- 在线时间
- 57 小时
|
5金钱
estimator.accZ = accZRemovalDead;
estimator.accZ -= 0.02f * errorZ * weight * weight * dt; /*补偿加速度*/
/*位置算法估测*/
estimator.positonZ += estimator.velocityZ * dt + estimator.accZ * dt * dt / 2.0f;
estimator.velocityZ += estimator.accZ * dt;
/*高度误差*/
errorZ = fusedHeight - estimator.positonZ;
以上是加速度补偿的几行程序,其中errorZ =实际高度-估算高度,如果errorZ>0,说明估算高度偏小,结合估算高度的公式estimator.positonZ += estimator.velocityZ * dt + estimator.accZ * dt * dt / 2.0f;可知,也就是估算加速度偏小,那么补偿加速度的时候应该让加速度值增加,而补偿加速度的程序是estimator.accZ -= 0.02f * errorZ * weight * weight * dt;这样不是会使加速度的估算值更加小了吗?这里是不是我哪里理解错了呢?
|
|