AC_PrecLand: honour return value for getCorrectedDeltaVelocityNED

we may not be able to get the base measurement for this from AP_InertialSensor
This commit is contained in:
Peter Barker
2026-06-04 10:38:56 +10:00
committed by Peter Barker
parent 44cec4640e
commit 65692fdc4e
+5 -3
View File
@@ -284,15 +284,17 @@ void AC_PrecLand::update(float rangefinder_alt_cm, bool rangefinder_alt_valid)
// append current velocity and attitude correction into history buffer
struct inertial_data_frame_s inertial_data_newest;
const auto &_ahrs = AP::ahrs();
_ahrs.getCorrectedDeltaVelocityNED(inertial_data_newest.correctedVehicleDeltaVelocityNED, inertial_data_newest.dt);
inertial_data_newest.Tbn = _ahrs.get_rotation_body_to_ned();
Vector3f curr_vel;
nav_filter_status status;
if (!_ahrs.get_velocity_NED(curr_vel) || !_ahrs.get_filter_status(status)) {
if (!_ahrs.getCorrectedDeltaVelocityNED(inertial_data_newest.correctedVehicleDeltaVelocityNED, inertial_data_newest.dt) ||
!_ahrs.get_velocity_NED(curr_vel) ||
!_ahrs.get_filter_status(status)) {
inertial_data_newest.inertialNavVelocityValid = false;
} else {
inertial_data_newest.inertialNavVelocityValid = status.flags.horiz_vel;
}
inertial_data_newest.Tbn = _ahrs.get_rotation_body_to_ned();
curr_vel.z = -curr_vel.z; // NED to NEU
inertial_data_newest.inertialNavVelocity = curr_vel;