AP_NavEKF2: Correct velocity and position outputs for IMU offset
This can improve position hold performance where it is not practical to have the IMU located at the centroid.
Although this enables the effect of IMU position offsets to be corrected, users will still need to be instructed to place the IMU as close to the vehicle c.g. as practical as correcting for large offsets makes the velocity estimates noisy.
mission-4.1.18
priseborough8 years agocommitted byAndrew Tridgell
// Write the last estimated NE position relative to the reference point (m).
// Write the last estimated NE position of the body frame origin relative to the reference point (m).
// Return true if the estimate is valid
boolNavEKF2_core::getPosNE(Vector2f&posNE)const
{
// There are three modes of operation, absolute position (GPS fusion), relative position (optical flow fusion) and constant position (no position estimate available)
if(PV_AidingMode!=AID_NONE){
// This is the normal mode of operation where we can use the EKF position states
posNE.x=outputDataNew.position.x;
posNE.y=outputDataNew.position.y;
// correct for the IMU offset (EKF calculations are at the IMU)
posNE.x=outputDataNew.position.x+posOffsetNED.x;
posNE.y=outputDataNew.position.y+posOffsetNED.y;
returntrue;
}else{
// In constant position mode the EKF position states are at the origin, so we cannot use them as a position estimate