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?
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?
Same here @LiaoYiDe
Even i want to use lidar for altitude estimation for QHover and QLoiter.
When i set EKF3_SRC_POSZ to rangefinder, get AHRS misconfigure error.
Also, I have a doubt that will the changes made does affect the forward flights for altitude estimations?
If yes what are the options to correct them?