mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 07:33:33 +08:00
ekf2: add unaided_yaw for more resilient yaw control
This estimate doesn't converge to the true yaw but can be used as a more consistent but drifting heading source. It can be used by a setpoint generator to adjust its heading setpoint while the true yaw estimate is converging in order to keep a constant course over ground.
This commit is contained in:
committed by
Mathieu Bresciani
parent
329a2d0e98
commit
0aa4afdbce
@@ -237,6 +237,11 @@ void OutputPredictor::calculateOutputStates(const uint64_t time_us, const Vector
|
||||
// rotate the relative velocity into earth frame
|
||||
_vel_imu_rel_body_ned = _R_to_earth_now * vel_imu_rel_body;
|
||||
}
|
||||
|
||||
// update auxiliary yaw estimate
|
||||
const Vector3f unbiased_delta_angle = delta_angle - delta_angle_bias_scaled;
|
||||
const float spin_del_ang_D = unbiased_delta_angle.dot(Vector3f(_R_to_earth_now.row(2)));
|
||||
_unaided_yaw = matrix::wrap_pi(_unaided_yaw + spin_del_ang_D);
|
||||
}
|
||||
|
||||
void OutputPredictor::correctOutputStates(const uint64_t time_delayed_us,
|
||||
|
||||
Reference in New Issue
Block a user