@ -430,10 +430,10 @@ bool NavEKF2_core::setOriginLLH(const Location &loc)
@@ -430,10 +430,10 @@ bool NavEKF2_core::setOriginLLH(const Location &loc)
}
// Set the NED origin to be used until the next filter reset
void NavEKF2_core : : setOrigin ( )
void NavEKF2_core : : setOrigin ( const Location & loc )
{
// assume origin at current GPS location (no averaging)
EKF_origin = AP : : gps ( ) . location ( ) ;
EKF_origin = loc ;
// if flying, correct for height change from takeoff so that the origin is at field elevation
if ( inFlight ) {
EKF_origin . alt + = ( int32_t ) ( 100.0f * stateStruct . position . z ) ;
@ -442,7 +442,11 @@ void NavEKF2_core::setOrigin()
@@ -442,7 +442,11 @@ void NavEKF2_core::setOrigin()
// define Earth rotation vector in the NED navigation frame at the origin
calcEarthRateNED ( earthRateNED , EKF_origin . lat ) ;
validOrigin = true ;
gcs ( ) . send_text ( MAV_SEVERITY_INFO , " EKF2 IMU%u Origin set to GPS " , ( unsigned ) imu_index ) ;
gcs ( ) . send_text ( MAV_SEVERITY_INFO , " EKF2 IMU%u origin set " , ( unsigned ) imu_index ) ;
// put origin in frontend as well to ensure it stays in sync between lanes
frontend - > common_EKF_origin = EKF_origin ;
frontend - > common_origin_valid = true ;
}
// record a yaw reset event