mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-08 17:08:28 -04:00
AP_NavEKF3: Fix bugs in use of wheel encoder data
Found by pavloblindnology
This commit is contained in:
parent
6d0cfc13a2
commit
ee6b43aabf
@ -1579,10 +1579,10 @@ void NavEKF3_core::SelectBodyOdomFusion()
|
||||
} else if (storedWheelOdm.recall(wheelOdmDataDelayed, imuDataDelayed.time_ms)) {
|
||||
|
||||
// check if the delta time is too small to calculate a velocity
|
||||
if (wheelOdmDataNew.delTime > EKF_TARGET_DT) {
|
||||
if (wheelOdmDataDelayed.delTime > EKF_TARGET_DT) {
|
||||
|
||||
// get the forward velocity
|
||||
float fwdSpd = wheelOdmDataNew.delAng * wheelOdmDataNew.radius * (1.0f / wheelOdmDataNew.delTime);
|
||||
float fwdSpd = wheelOdmDataDelayed.delAng * wheelOdmDataDelayed.radius * (1.0f / wheelOdmDataDelayed.delTime);
|
||||
|
||||
// get the unit vector from the projection of the X axis onto the horizontal
|
||||
Vector3f unitVec;
|
||||
@ -1598,7 +1598,7 @@ void NavEKF3_core::SelectBodyOdomFusion()
|
||||
// TODO write a dedicated observation model for wheel encoders
|
||||
usingWheelSensors = true;
|
||||
bodyOdmDataDelayed.vel = prevTnb * velNED;
|
||||
bodyOdmDataDelayed.body_offset = wheelOdmDataNew.hub_offset;
|
||||
bodyOdmDataDelayed.body_offset = wheelOdmDataDelayed.hub_offset;
|
||||
bodyOdmDataDelayed.velErr = frontend->_wencOdmVelErr;
|
||||
|
||||
// Fuse data into the main filter
|
||||
|
Loading…
Reference in New Issue
Block a user