mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-02 10:23:25 +08:00
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:
committed by
Peter Barker
parent
44cec4640e
commit
65692fdc4e
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user