diff --git a/src/modules/ekf2/ekf2_main.cpp b/src/modules/ekf2/ekf2_main.cpp index bf052d6e44..5d19dd3059 100644 --- a/src/modules/ekf2/ekf2_main.cpp +++ b/src/modules/ekf2/ekf2_main.cpp @@ -1398,6 +1398,11 @@ void Ekf2::run() _ekf.set_gnd_effect_flag(true); } + // update ground effect flag based on land detector state + else if (vehicle_land_detected_updated && _gnd_effect_deadzone.get() > 0.0f) { + _ekf.set_gnd_effect_flag(vehicle_land_detected.in_ground_effect); + } + lpos.dist_bottom_rate = -lpos.vz; // Distance to bottom surface (ground) change rate _ekf.get_ekf_lpos_accuracy(&lpos.eph, &lpos.epv); diff --git a/src/modules/land_detector/LandDetector.h b/src/modules/land_detector/LandDetector.h index a60c2a9eb4..e8954ee781 100644 --- a/src/modules/land_detector/LandDetector.h +++ b/src/modules/land_detector/LandDetector.h @@ -185,8 +185,8 @@ private: bool _previous_arming_state{false}; ///< stores the previous _arming.armed state - int _parameterSub{-1}; - int _armingSub{-1}; + int _parameterSub{ -1}; + int _armingSub{ -1}; }; diff --git a/src/modules/land_detector/MulticopterLandDetector.h b/src/modules/land_detector/MulticopterLandDetector.h index 0b66e00748..58444e5c77 100644 --- a/src/modules/land_detector/MulticopterLandDetector.h +++ b/src/modules/land_detector/MulticopterLandDetector.h @@ -122,13 +122,13 @@ private: float landSpeed; } _params{}; - int _vehicleLocalPositionSub{-1}; - int _vehicleLocalPositionSetpointSub{-1}; - int _actuatorsSub{-1}; - int _attitudeSub{-1}; - int _sensor_bias_sub{-1}; - int _vehicle_control_mode_sub{-1}; - int _battery_sub{-1}; + int _vehicleLocalPositionSub{ -1}; + int _vehicleLocalPositionSetpointSub{ -1}; + int _actuatorsSub{ -1}; + int _attitudeSub{ -1}; + int _sensor_bias_sub{ -1}; + int _vehicle_control_mode_sub{ -1}; + int _battery_sub{ -1}; vehicle_local_position_s _vehicleLocalPosition {}; vehicle_local_position_setpoint_s _vehicleLocalPositionSetpoint {};