Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add get_airspeed method to lua bindings #28044

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions libraries/AP_Scripting/docs/docs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3209,6 +3209,28 @@ function battery:num_instances() end
---@return number|nil
function battery:get_cell_voltage(instance, cell) end

-- The Airspeed library provides access to airspeed sensors information.
airspeed = {}

-- desc
AlexisMGL marked this conversation as resolved.
Show resolved Hide resolved
---@param instance integer
---@return boolean
function airspeed:enabled(instance)) end

-- desc
---@param instance integer
---@return boolean
function airspeed:healthy(instance)) end

-- Get airspeed for the given sensor instance
---@param instance integer
---@return number -- airspeed in m/s -1 if invalid.
function airspeed:get_airspeed(instance) end

-- desc
---@param instance integer
---@return number -- raw_airspeed in m/s -1 if invalid.
function airspeed:get_raw_airspeed(instance)) end

-- The Arming library provides access to arming status and commands.
arming = {}
Expand Down
8 changes: 8 additions & 0 deletions libraries/AP_Scripting/generator/description/bindings.desc
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ singleton AP_AHRS method initialised boolean
singleton AP_AHRS method get_posvelyaw_source_set uint8_t
singleton AP_AHRS method get_quaternion boolean Quaternion'Null

include AP_Airspeed/AP_Airspeed.h
AlexisMGL marked this conversation as resolved.
Show resolved Hide resolved
singleton AP_Airspeed depends AP_AIRSPEED_ENABLED
singleton AP_Airspeed rename airspeed
singleton AP_Airspeed method enabled boolean uint8_t 0 (AIRSPEED_MAX_SENSORS-1)
singleton AP_Airspeed method healthy boolean uint8_t 0 (AIRSPEED_MAX_SENSORS-1)
singleton AP_Airspeed method get_airspeed float uint8_t 0 (AIRSPEED_MAX_SENSORS-1)
singleton AP_Airspeed method get_raw_airspeed float uint8_t 0 (AIRSPEED_MAX_SENSORS-1)

include AP_Arming/AP_Arming.h

singleton AP_Arming rename arming
Expand Down
Loading