-
Notifications
You must be signed in to change notification settings - Fork 19k
AP_Scripting: update docs file to be more comprehensive #30504
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chat-GPT strikes again?
It certainty would be nice to get everything fully documented. But we have to make sure its documented correctly. I have only reviewed a small part of this, quite a bit of it is just wrong. I'm happy to work with you to get this across the line but I'm not interested in spending several hours reviewing PRs that were generated in 5 mins using AI.
---@return integer | ||
function uint32_t_ud:toint() end | ||
|
||
--- Custom 64-bit unsigned integer userdata type. | ||
-- Essential for high-resolution timestamps (like from `micros()`) or large IDs where standard Lua numbers would lose precision. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
micros
returns uint32. This is used in utc epoch from the gps, and a few places in DroneCAN.
---@return uint32_t_ud -- microseconds | ||
-- Returns the system time in microseconds since the autopilot booted. | ||
-- This should be stored in a uint64_t_ud to avoid precision loss. | ||
---@return uint64_t_ud -- Microseconds since boot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
---@return uint64_t_ud -- Microseconds since boot. | |
---@return uint32_t_ud -- Microseconds since boot. |
-- Prints text to the GCS and connected peripherals. | ||
-- If a MAVLink GCS is connected, this is equivalent to `gcs:send_text(MAV_SEVERITY.DEBUG, text)`. | ||
-- If the script is running on a peripheral, the text will be sent over the CAN bus. | ||
---@param text string|number|integer -- The content to be printed. Non-string types will be converted to strings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we convert none strings? I might be worth testing, our print is not a nice as the built in print.
---@param ... integer|number|uint32_t_ud|string|boolean -- data to be logged, type to match format string | ||
-- Writes a custom log entry to the dataflash log with full formatting options. A timestamp is automatically added. | ||
-- Example from `revert_param.lua`: `logger:write('QUIK','SRate,Gain,Param', 'ffn', srate, P:get(), axis .. stage)` | ||
---@param name string -- A unique name for the log entry, must be 4 characters or less to avoid conflicts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
---@param name string -- A unique name for the log entry, must be 4 characters or less to avoid conflicts. | |
---@param name string -- A unique name for the log entry, must be 4 characters or less. |
-- Example from `revert_param.lua`: `logger:write('QUIK','SRate,Gain,Param', 'ffn', srate, P:get(), axis .. stage)` | ||
---@param name string -- A unique name for the log entry, must be 4 characters or less to avoid conflicts. | ||
---@param labels string -- Comma-separated labels for the data fields, up to 58 characters. E.g., "Lat,Lon,Alt". | ||
---@param format string -- A format string defining the data types of the values. See https://ardupilot.org/dev/docs/code-overview-logger.html for format specifiers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This URL does not exist.
---@class (exact) EFI_State_ud | ||
local EFI_State_ud = {} | ||
|
||
---@return EFI_State_ud | ||
function EFI_State() end | ||
|
||
-- get field | ||
-- get field: Pressure/Temperature compensation for the engine. | ||
---@return number | ||
function EFI_State_ud:pt_compensation() end | ||
|
||
-- set field |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set description should match that for get.
---@return number | ||
function EFI_State_ud:fuel_consumption_rate_cm3pm() end | ||
|
||
-- set field | ||
---@param value number | ||
function EFI_State_ud:fuel_consumption_rate_cm3pm(value) end | ||
|
||
-- get field | ||
-- get field: The current fuel pressure, typically in kPa. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not typicaly, always in kPa.
@@ -233,87 +244,87 @@ function EFI_State_ud:fuel_pressure_status() end | |||
---| '3' # Above nominal | |||
function EFI_State_ud:fuel_pressure_status(status) end | |||
|
|||
-- get field | |||
-- get field: The engine oil temperature, typically in degrees Celsius. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- get field: The engine oil temperature, typically in degrees Celsius. | |
-- get field: The engine oil temperature, kelvin. |
---@return number | ||
function EFI_State_ud:oil_temperature() end | ||
|
||
-- set field | ||
---@param value number | ||
function EFI_State_ud:oil_temperature(value) end | ||
|
||
-- get field | ||
-- get field: The engine oil pressure, typically in kPa. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- get field: The engine oil pressure, typically in kPa. | |
-- get field: The engine oil pressure, in kPa. |
---@return number | ||
function EFI_State_ud:oil_pressure() end | ||
|
||
-- set field | ||
---@param value number | ||
function EFI_State_ud:oil_pressure(value) end | ||
|
||
-- get field | ||
-- get field: The engine coolant temperature, typically in degrees Celsius. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- get field: The engine coolant temperature, typically in degrees Celsius. | |
-- get field: The engine coolant temperature, kelvin. |
No description provided.