Skip to content

Commit

Permalink
AP_Scripting: Add threshold arguments to consistency checks
Browse files Browse the repository at this point in the history
Added arguments to the gyros_consistent and accels_consistent methods for allowable threshold and required time for checks
  • Loading branch information
haydendonald authored and bugobliterator committed Mar 22, 2024
1 parent 351e14d commit bcce99d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions libraries/AP_Scripting/docs/docs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1391,8 +1391,10 @@ ins = {}
function ins:get_temperature(instance) end

-- Check if the gyrometers are consistent
---@param threshold integer -- the allowed threshold in degrees per second
---@param consistency_seconds integer -- how many seconds to require consistent data for
---@return boolean
function ins:gyros_consistent() end
function ins:gyros_consistent(threshold, consistency_seconds) end

-- Check if a specific gyrometer sensor is healthy
---@param instance integer -- the 0-based index of the gyrometer instance to return.
Expand All @@ -1401,8 +1403,9 @@ function ins:get_gyro_health(instance) end

-- Check if the accelerometers are consistent
---@param threshold float -- the threshold allowed before returning false
---@param consistency_seconds integer -- how many seconds to require consistent data for
---@return boolean
function ins:accels_consistent(threshold) end
function ins:accels_consistent(threshold, consistency_seconds) end

-- Check if a specific accelerometer sensor is healthy
---@param instance integer -- the 0-based index of the accelerometer instance to return.
Expand Down
4 changes: 2 additions & 2 deletions libraries/AP_Scripting/generator/description/bindings.desc
Original file line number Diff line number Diff line change
Expand Up @@ -531,9 +531,9 @@ include AP_InertialSensor/AP_InertialSensor.h
singleton AP_InertialSensor rename ins
singleton AP_InertialSensor method get_temperature float uint8_t 0 INS_MAX_INSTANCES
singleton AP_InertialSensor method get_gyro_health boolean uint8_t'skip_check
singleton AP_InertialSensor method accels_consistent boolean float'skip_check
singleton AP_InertialSensor method accels_consistent boolean float'skip_check uint8_t'skip_check
singleton AP_InertialSensor method get_accel_health boolean uint8_t'skip_check
singleton AP_InertialSensor method gyros_consistent boolean
singleton AP_InertialSensor method gyros_consistent boolean uint8_t'skip_check uint8_t'skip_check
singleton AP_InertialSensor method get_gyro_health_locked boolean uint8_t'skip_check
singleton AP_InertialSensor method get_accel_health_locked boolean uint8_t'skip_check
singleton AP_InertialSensor method get_gyro Vector3f uint8_t'skip_check
Expand Down

0 comments on commit bcce99d

Please sign in to comment.