AP_GPS: account for rotation rate in moving baseline Z test
this avoids switching GPS on rapid roll/pitch
This commit is contained in:
parent
2168633372
commit
8bc31ec5e9
@ -353,8 +353,20 @@ bool AP_GPS_Backend::calculate_moving_base_yaw(const float reported_heading_deg,
|
||||
|
||||
#ifndef HAL_BUILD_AP_PERIPH
|
||||
{
|
||||
const Vector3f antenna_tilt = AP::ahrs().get_rotation_body_to_ned() * offset;
|
||||
// get lag
|
||||
float lag = 0.1;
|
||||
get_lag(lag);
|
||||
|
||||
// get vehicle rotation, projected back in time using the gyro
|
||||
auto &ahrs = AP::ahrs();
|
||||
const Vector3f &gyro = ahrs.get_gyro();
|
||||
Matrix3f rot_body_to_ned = ahrs.get_rotation_body_to_ned();
|
||||
rot_body_to_ned.rotate(gyro * (-lag));
|
||||
|
||||
// apply rotation to the offset to get the Z offset in NED
|
||||
const Vector3f antenna_tilt = rot_body_to_ned * offset;
|
||||
const float alt_error = reported_D + antenna_tilt.z;
|
||||
|
||||
if (fabsf(alt_error) > permitted_error_length_pct * min_dist) {
|
||||
// the vertical component is out of range, reject it
|
||||
goto bad_yaw;
|
||||
|
Loading…
Reference in New Issue
Block a user