Commit Graph

36682 Commits

Author SHA1 Message Date
Peter Barker ba2bec07fa AP_HAL_ChibiOS: add env option to omit hwdef.dat from romfs 2024-08-05 10:20:14 +10:00
Andrew Tridgell 9543eecf23 HAL_ChibiOS: fixed AP_FILESYSTEM_ROMFS_ENABLED for peripherals with defaults.parm
now that defaults are in ROMFS we must enable
AP_FILESYSTEM_ROMFS_ENABLED
2024-08-04 17:36:31 +10:00
Andrew Tridgell 7bdb8d770d SRV_Channel: added AM32 to the SERVO_DSHOT_ESC param docs
setting 3 works well with AM32
2024-08-04 07:31:22 +10:00
Andrew Tridgell d48f9ef12c AP_Scripting: added example copter_deploy.lua 2024-08-03 14:29:51 +10:00
Andrew Tridgell ebad1631d7 AP_Scripting: added arm_force() and baro get_altitude_difference() 2024-08-03 14:29:51 +10:00
Andrew Tridgell 6a1d09959b AP_Arming: added arm_force() for scripting 2024-08-03 14:29:51 +10:00
EternAlmox 2ad7177a39 AP_HAL_ChibiOS: added MFT-SEMA100 2024-08-02 18:40:59 +10:00
Peter Barker bc1c305629 AP_HAL: default SITL and Linux to have 4MB of "flash" 2024-08-02 16:29:57 +10:00
Peter Barker 894b99fce5 AP_HAL: remove unused HAL_MINIMIZE_FEATURES define 2024-08-02 16:29:57 +10:00
Peter Barker 9049aeaff6 GCS_MAVLink: accept mavlink standard force arm/disarm value for forced arming
the mavlink standard specifies just one value to do either arm or disarm.  Conform to that standard
2024-08-02 16:29:13 +10:00
DisCoLabIITK e929cc21b1 AP_CustomControl: Update README.md
Adding step for changes that need to be done in the AC_CustomControl_config.h file to prevent error while compilation.
2024-08-01 10:23:14 +10:00
Pierre Kancir d9eabcf411 AP_Vehicle: fix compile when AP_EXTERNAL_CONTROL_ENABLED disabled 2024-08-01 10:00:07 +10:00
Henry Wurzburg e4fc9b0b58 AC_Fence:Add AUTOENABLE deprecation warning
Co-authored-by: Peter Barker <pb-gh@barker.dropbear.id.au>
2024-08-01 09:39:41 +10:00
Peter Barker 90ee339806 AC_PID: rename pid setters to include set_ in the names 2024-07-31 18:43:42 +10:00
Peter Barker 7f4074a22c AC_AutoTune: rename pid setters to include set_ in the names 2024-07-31 18:43:42 +10:00
Peter Barker fae3b39b15 AC_AttitudeControl: rename pid setters to include set_ in the names 2024-07-31 18:43:42 +10:00
Iampete1 21ad679b61 AP_HAL_ChibiOS: GPIO: read: support virtual read of IOMCU pins 2024-07-31 18:13:01 +10:00
Iampete1 60d579dc88 AP_HAL_ChibiOS: GPIO: Check IOMCU after local pins for speed 2024-07-31 18:13:01 +10:00
Iampete1 624ab00c3e AP_HAL_ChibiOS: RCOut banner: check for GPIO on IOMCU 2024-07-31 18:13:01 +10:00
Iampete1 98c5eff7f0 AP_IOMCU: add GPIO mask getter and GPIO virtual read 2024-07-31 18:13:01 +10:00
Andy Piper b9bde4c488 AP_HAL_ChibiOS: add servo outputs as motors to FoxeerF405v2 2024-07-31 17:27:44 +10:00
Henry Wurzburg 847b8eab25 HWDEF:fix CUAV-7-Nano default batt monitor 2024-07-31 17:13:09 +10:00
Henry Wurzburg 9b041be8a1 AC_Fence: correct prearm message 2024-07-31 17:01:07 +10:00
Eric Katzfey 9ef76de0c9 AP_HAL_QURT: Added support for dual mavlink streams 2024-07-31 10:00:35 +10:00
Peter Barker d7caf1e6b5 AP_Math: remove method operator
remove the metho operator from the class.

This means this will no longer work:

Quaternion q{0,1,2,3};
q(5,6,7,8);

.... that used to set the quaternion componets, but is an odd / atypical syntax to use
2024-07-31 08:54:37 +10:00
Peter Barker cac2c63e72 AC_PID: remove method operator
remove the metho operator from the class.

This means this will no longer work:

Quaternion q{0,1,2,3};
q(5,6,7,8);

.... that used to set the quaternion componets, but is an odd / atypical syntax to use
2024-07-31 08:54:37 +10:00
Hayden Donald 52ba8e8513 AP_Scripting: Change serial depends HAL_GCS to AP_SERIALMANAGER
Serial bindings were dependant on HAL_GCS_ENABLED but this is not ideal, it should be dependant on AP_SERIALMANAGER_ENABLED so that serial can function without GCS
2024-07-31 08:27:34 +10:00
“Jane_ZeroOne” d43dd5227a AP_HAL_ChibiOS: add ZeroOneX6 2024-07-30 20:07:31 +10:00
Iampete1 26c51a8002 AP_TemperatureSensor: add logging option to only log sensors with no source 2024-07-30 11:07:17 +10:00
Iampete1 600d9eb7a8 AP_BattMonitor: Sum: report average temperature 2024-07-30 11:00:49 +10:00
Iampete1 45647718cb AP_BattMonitor: ESC: integrate consumed mah if not provided by ESC 2024-07-30 10:59:17 +10:00
Thomas Watson dc4d1bacdd AP_Scripting: adjust string metatable setup to fix sandbox integrity
In Lua, strings are the only type that come with a default metatable.
The metatable must be shared by all string objects, and it is set to be
the `string` library table each time that library is opened. In
Ardupilot's scripting engine, the last script to load then has access to
the string metatable as the library is opened fresh for each script, as
its `string` library will have been set to the metatable.

Therefore, if two scripts are loaded, A first and B second, and script B
executes e.g. `string.byte = "haha"`, then `string.byte()` and
`s:byte()` for script B are broken. Because the metatable is shared,
this also breaks `s:byte()` for script A, which violates the integrity
of the sandbox.

Fix the issue by disabling the metatable setup functionality when the
string libary is opened, then manually opening an additional copy of the
library (which won't be given to any script) and setting it as the
string metatable during intialization.

This will break any script that modifies the string metatable for
constructive purposes, but such a script could have been broken if it
weren't the only script running anyway.
2024-07-30 10:54:00 +10:00
Peter Barker 95281e5c17 hwdef: turn monior thread back on on some boards
most of these boards probably don't need it, but to make a PR no-binary-output...
2024-07-30 10:52:36 +10:00
Peter Barker 90b2a2acaa hwdef: change HAL_NO_MONITOR_THREAD out for HAL_MONITOR_THREAD_ENABLED
... and use a default value for peripherals
2024-07-30 10:52:36 +10:00
Thomas Watson 3a834e83c7 AP_Scripting: reference script environment directly
Referencing the original function to run is of questionable value and
the only user uses it to grab the script environent from the upvalues.

Instead, use a reference to the script environment table directly.
2024-07-30 10:33:56 +10:00
Thomas Watson 15255a36e4 AP_Scripting: reference function to run separately
Some bits of the code in the require machinery use the `lua_ref` to
access the script environment. However, this can change after the script
is rescheduled and it returns an arbitrary function to run next.

Resolve this by introducing `run_ref` which is specifically a reference
to the function to run next. `lua_ref` is preserved for the script
lifetime.
2024-07-30 10:33:56 +10:00
Thomas Watson da006d427d AP_Scripting: add test for require() after rescheduling
It can end up broken due to incorrect assumptions about the executed
function's upvalues, which might change after rescheduling.
2024-07-30 10:33:56 +10:00
Peter Barker be377da6a4 GCS_MAVLink: add build option to not send RC_CHANNELS_RAW
we keep this around in case we break old OSD setups
2024-07-30 10:29:58 +10:00
Peter Barker 6f5ea5a5e9 RC_Channel: rework duplicate-rc-options check to use a Bitmask
just for the memory saving.

Co-authored-by: muramura <ma2maru@gmail.com>
2024-07-30 10:28:42 +10:00
Peter Barker 93704c573c SITL: add documentation for SIM_ENGINE_FAIL and SIM_ENGINE_MUL 2024-07-30 09:21:26 +09:00
Peter Barker 9397ece55a AC_AutoTune: make axis-type enum-class
Co-authored-by: Andrew Tridgell <andrew@tridgell.net>
2024-07-30 10:20:26 +10:00
Peter Barker f3766b831a AP_HAL_ChibiOS: make include file mistakes nicer to interpret 2024-07-30 09:57:01 +10:00
Thomas Watson 6acfc98cf4 AP_Scripting: factor out ap_object checker
Reduces flash usage.

Saves ~160B.
2024-07-30 09:55:25 +10:00
Thomas Watson 212256731f AP_Scripting: improve object allocation efficiency
Make new_X return the new object instead of having to grab it to
configure it.

Saves ~1.3K.
2024-07-30 09:55:25 +10:00
Thomas Watson 3e05cd9729 AP_Scripting: factor out field access argument error
Saves ~830B.
2024-07-30 09:55:25 +10:00
Thomas Watson 575ed6224f AP_Scripting: improve binding index function efficiency
Move the string checks into the load functions to avoid duplicating it
for each binding.

Also sync up the return types to avoid an unnecessary conversion.

Saves ~1.5K.
2024-07-30 09:55:25 +10:00
Thomas Watson e66d2a1495 AP_Scripting: remove redundant memsets
Matches current generator behavior.
2024-07-30 09:55:25 +10:00
Thomas Watson 837b17e82e AP_Scripting: more intelligently manage Lua stack
The Lua stack is guaranteed to have at least LUA_MINSTACK (default 20)
slots upon entry to C. Check to see if we might need more than that
minimum and only in that case call the function to check and resize the
stack. In virtually all cases the check can then be optimized away.

Additionally remove the redundant "Out of stack" message. Lua already
says "stack overflow" and a null message is valid.

Saves ~330B.
2024-07-30 09:55:25 +10:00
Thomas Watson 7212e35fb0 AP_Scripting: slightly improve codegen
Get singleton pointer closer to where it is used.

Saves ~170B.
2024-07-30 09:55:25 +10:00
Thomas Watson 60a9f1722c AP_DroneCAN: DNA_Server: unify bitmask handling
Put documentation with each bitmask and use the object directly. Node ID
range checks can be removed as the bitmask itself checks and we don't
expect to trip them.

Substantially cleans up the code.
2024-07-30 09:49:43 +10:00