Skip to content

Commit

Permalink
AP_Scripting: expose sub rangefinder methods
Browse files Browse the repository at this point in the history
  • Loading branch information
clydemcqueen authored and Williangalvani committed Feb 21, 2024
1 parent 37e7c33 commit b486c1c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions libraries/AP_Scripting/docs/docs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1691,6 +1691,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
Expand Down
3 changes: 3 additions & 0 deletions libraries/AP_Scripting/generator/description/bindings.desc
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,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
Expand Down

0 comments on commit b486c1c

Please sign in to comment.