|
|
|
@ -215,10 +215,10 @@ float Sub::get_land_descent_speed()
@@ -215,10 +215,10 @@ float Sub::get_land_descent_speed()
|
|
|
|
|
bool sonar_ok = false; |
|
|
|
|
#endif |
|
|
|
|
// if we are above 10m and the sonar does not sense anything perform regular alt hold descent
|
|
|
|
|
if (pos_control.get_pos_target().z >= pv_alt_above_origin(LAND_START_ALT) && !(sonar_ok && sonar_alt_health >= SONAR_ALT_HEALTH_MAX)) { |
|
|
|
|
return pos_control.get_speed_down(); |
|
|
|
|
if (pos_control.get_pos_target().z <= pv_alt_above_origin(LAND_START_ALT) && !(sonar_ok && sonar_alt_health >= SONAR_ALT_HEALTH_MAX)) { |
|
|
|
|
return pos_control.get_speed_up(); |
|
|
|
|
}else{ |
|
|
|
|
return -abs(g.land_speed); |
|
|
|
|
return abs(g.land_speed); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|