AP_Scripting: expose sub rangefinder methods

This commit is contained in:
Clyde McQueen 2024-02-21 12:11:46 -08:00 committed by Willian Galvani
parent 9ca244fc66
commit 9163d9b8bf
2 changed files with 16 additions and 0 deletions

View File

@ -1668,6 +1668,19 @@ function sub:is_button_pressed(index) end
---@return integer
function sub:get_and_clear_button_count(index) end
-- Return true if rangefinder is healthy, includes a check for good signal quality
---@return boolean
function sub:rangefinder_alt_ok() end
-- SURFTRAK mode: return the rangefinder target in cm
---@return float
function sub:get_rangefinder_target_cm() end
-- SURFTRAK mode: set the rangefinder target in cm, return true if successful
---@param new_target_cm float
---@return boolean
function sub:set_rangefinder_target_cm(new_target_cm) end
-- desc
---@class quadplane

View File

@ -534,6 +534,9 @@ singleton Sub rename sub
singleton Sub depends APM_BUILD_TYPE(APM_BUILD_ArduSub)
singleton Sub method get_and_clear_button_count uint8_t uint8_t 1 4
singleton Sub method is_button_pressed boolean uint8_t 1 4
singleton Sub method rangefinder_alt_ok boolean
singleton Sub method get_rangefinder_target_cm float
singleton Sub method set_rangefinder_target_cm boolean float'skip_check
include AP_Motors/AP_MotorsMatrix.h depends APM_BUILD_TYPE(APM_BUILD_ArduPlane)||APM_BUILD_COPTER_OR_HELI
singleton AP_MotorsMatrix depends APM_BUILD_TYPE(APM_BUILD_ArduPlane)||APM_BUILD_COPTER_OR_HELI