VTOL to use Rangefinder altitude in Qhover and Qloiter flight modes

I want VTOL to use Rangefinder altitude in Qhover and Qloiter flight modes

My hardware configuration
Autopilot: cubeorange+
Rangefinder: LW20
Arduplane firmware: 4.3.5

Parameter setting
RNGFND1_TYPE = 7
RNGFND1_ADDR = 102
RNGFND1_SCALING = 1
RNGFND1_MIN_CM = 5
RNGFND1_MAX_CM = 9500
RNGFND1_GNDCLEAR = 11 (Rangefinder height from ground)

Previously I try Copter firmware according to tutorial, PosHold can use the height of the rangefinder.
After switching to Plane firmware, it is also set according to tutorial, but unfortunately, the altitude cannot be used in QHover and QLoiter
I’ve tried placing objects under the Rangefinder during the QHover flight to try and get the plane to lift altitude in order to maintain altitude, but that didn’t work.

I would like to ask how to set it so that VTOL can use the altimeter to determine the altitude in Qhover and Qloiter?

Thank you!!

I try to use lua script to solve this problem, but not work.

I use rangefinder:distance_cm_orient() to obtain the information of rangefinder, and overwrite the altitude information with the current altitude, and then use set_target_location() to set the new location. But target_alt has not changed after using the script, and set_target_location() will return False, it seems that the setting is not successful.

 if vehicle_mode == MODE_QHOVER or vehicle_mode == MODE_QLOITER then
      local position = Location()          -- get home location
      local rf_alt = rangefinder:distance_cm_orient(RNG_ORIENT_DOWN)
      if position then
         pre_position = position:copy()
         position:alt(rf_alt)
         sent_target = vehicle:set_target_location(position)   -- set target above home
      end

Dose anyone know how to let my quadplane use rangefinder to qloiter and qhover?

did you ever solve this problem?

Not yet
very sorry about that