do not stick to terrain estimate if it's not valid

This commit is contained in:
tumbili
2015-10-19 13:49:22 +02:00
committed by Roman
parent 4e22d65325
commit 73b1c18698
@@ -963,7 +963,7 @@ float FixedwingPositionControl::get_terrain_altitude_landing(float land_setpoint
/* Decide if the terrain estimation can be used, once we switched to using the terrain we stick with it
* for the whole landing */
if (_parameters.land_use_terrain_estimate && (global_pos.terrain_alt_valid || land_useterrain)) {
if (_parameters.land_use_terrain_estimate && global_pos.terrain_alt_valid) {
if(!land_useterrain) {
mavlink_log_info(_mavlink_fd, "Landing, using terrain estimate");
land_useterrain = true;