EKF: capture horizontal position reset events

This commit is contained in:
Paul Riseborough
2016-06-01 17:13:00 +10:00
parent e3a1b4a3b3
commit 0605c88ecc
+5 -1
View File
@@ -148,7 +148,7 @@ bool Ekf::resetPosition()
}
// calculate the change in position and apply to the output predictor state history
Vector3f posNE_change;
Vector2f posNE_change;
posNE_change(0) = _state.pos(0) - posNE_before_reset(0);
posNE_change(1) = _state.pos(1) - posNE_before_reset(1);
outputSample output_states;
@@ -160,6 +160,10 @@ bool Ekf::resetPosition()
_output_buffer.push_to_index(index,output_states);
}
// capture the reset event
_state_reset_status.posNE_change = posNE_change;
_state_reset_status.posNE_time_us = _imu_sample_delayed.time_us;
}
// Reset height state using the last height measurement