mirror of https://github.com/ArduPilot/ardupilot
AP_NavEKF2: Correct range finder data for body frame position offset
This commit is contained in:
parent
e884e9cc6e
commit
16f021c466
|
@ -650,6 +650,15 @@ void NavEKF2_core::selectHeightForFusion()
|
||||||
readRangeFinder();
|
readRangeFinder();
|
||||||
rangeDataToFuse = storedRange.recall(rangeDataDelayed,imuDataDelayed.time_ms);
|
rangeDataToFuse = storedRange.recall(rangeDataDelayed,imuDataDelayed.time_ms);
|
||||||
|
|
||||||
|
// correct range data for the body frame position offset relative to the IMU
|
||||||
|
// the corrected reading is the reading that would have been taken if the sensor was
|
||||||
|
// co-located with the IMU
|
||||||
|
if (rangeDataToFuse) {
|
||||||
|
Vector3f posOffsetBody = rangeDataDelayed.body_offset - accelPosOffset;
|
||||||
|
Vector3f posOffsetEarth = prevTnb.mul_transpose(posOffsetBody);
|
||||||
|
rangeDataDelayed.rng += posOffsetEarth.z / prevTnb.c.z;
|
||||||
|
}
|
||||||
|
|
||||||
// read baro height data from the sensor and check for new data in the buffer
|
// read baro height data from the sensor and check for new data in the buffer
|
||||||
readBaroData();
|
readBaroData();
|
||||||
baroDataToFuse = storedBaro.recall(baroDataDelayed, imuDataDelayed.time_ms);
|
baroDataToFuse = storedBaro.recall(baroDataDelayed, imuDataDelayed.time_ms);
|
||||||
|
|
Loading…
Reference in New Issue