Landing at an altitude greater than 10m above HOME

Can anyone say what will happen if the LAND command is triggered at say 30m above home altitude at a location which is actually 15 m above the ground level the copter is now over? Based on the docs its possible the copter will come crashing down using WPNAV_SPEED_DN (which could be high) before actually getting to slow down to LAND_SPEED as it would hit the ground. Am I correct in my assessment?

Regards,
Maurice

That’s the logic - yes.
But if you enable sonar before autoland, it will work fine anyway:

// if we are above 10m and the sonar does not sense anything perform regular alt hold descent if (current_loc.alt >= LAND_START_ALT && !(g.sonar_enabled && sonar_alt_health >= SONAR_ALT_HEALTH_MAX)) { return pos_control.get_speed_down(); }else{ return -abs(g.land_speed); }

So, if one does not have sonar, what happens?

Your original concept will happen - it will descend at the WPNAV_SPEED_DN rate, thinking it is much higher above the ground than it really is. This may result in a much quicker landing than you were anticipating. If the quad doesn’t have a sensor to determine where the ground is, then it can’t make any other decision beyond assuming the ground is the same height it was when it took off.

In a case like that I would switch to AltHold or Stabilize and land manually, OR set a very conservative speed for WPNAV_SPEED_DN which would allow for an acceptable landing (maybe not graceful, but survivable).

then it uses sonar altitude, and once its <= 10m , descend rate is set by LAND_SPEED