Commit Graph

64884 Commits

Author SHA1 Message Date
Peter Barker 93704c573c SITL: add documentation for SIM_ENGINE_FAIL and SIM_ENGINE_MUL 2024-07-30 09:21:26 +09:00
Peter Barker 6881f42cba Copter: add a Mode method to disable crash check
prevents looking for specific modes in the crash checker
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
Iampete1 55f51eabe8 Plane: move `have_autoenabled_fences` to be private in `ModeTakeoff` 2024-07-30 09:59:01 +10:00
Peter Barker 535f806c96 Tools: make include file mistakes nicer to interpret 2024-07-30 09:57:01 +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
Thomas Watson 56593574a9 AP_DroneCAN: DNA_Server: miscellaneous cleanup 2024-07-30 09:49:43 +10:00
Thomas Watson 5e0bb99dbb AP_DroneCAN: DNA_Server: fix handling of empty entry
Replaces the check for a CRC of 0 with a check that the hwid is 0.
Substantially reduces 1/256 chance that a particular node ID couldn't be
stored.
2024-07-30 09:49:43 +10:00
Thomas Watson 9aeab7b424 AP_DroneCAN: DNA_Server: use 0 as unknown ID
Slightly reduces flash usage and probably is clearer.
2024-07-30 09:49:43 +10:00
Thomas Watson 8d57533f1c AP_DroneCAN: DNA_Server: fix cases involving use of invalid node IDs 2024-07-30 09:49:43 +10:00
Thomas Watson a9317b1a07 AP_DroneCAN: correct and validate allowed NODE range
Node IDs >= 128 don't exist, and IDs 126 and 127 are "reserved for
network maintenance tools" according to the spec.
2024-07-30 09:49:43 +10:00
Thomas Watson 485a9387b1 AP_DroneCAN: DNA_Server: clean up storage failure handling
The StorageManager read_block/write_block methods only return failure if
an out of bounds access is performed. Assert statically that this does
not happen.

Also remove the now-impossible failed to add node state.
2024-07-30 09:49:43 +10:00
Thomas Watson cd8519321b AP_DroneCAN: DNA_Server: search for valid nodes after magic check
Ensures the occupation mask doesn't get populated with junk if the magic
is not valid.
2024-07-30 09:49:43 +10:00
Thomas Watson c1f59186fa AP_DroneCAN: DNA_Server: make reset method private 2024-07-30 09:49:43 +10:00
Ian Burwell 6b4e11090c AP_Scripting: Add BQ40Z shutdown example
This example intercepts PREFLIGHT_REBOOT_SHUTDOWN COMMAND_LONG's and if
param1==2, it shuts down the BQ40Z smart battery BMS. Otherwise it
passes through the COMMAND_LONG as a COMMAND_INT (this required updating
the gcs:run_command_int to return a MAV_RESULT rather than a bool).
2024-07-30 09:40:10 +10:00
Ian Burwell 9d34fa2a5e AP_Scripting: Add I2C transfer bindings
This adds bindings for an I2CDevice's transfer() function, an example,
and removes the nil return hint from the get_device() docs as it never
actually returns nil.
2024-07-30 09:40:10 +10:00
muramura 0e7a5ef520 Copter: Make multiple decisions into a SWITCH statement 2024-07-30 08:16:27 +09:00
Iampete1 838fbc2b3b AP_Param: Fix `ENABLE_DEBUG` enabled error with no embedded param 2024-07-30 08:51:09 +10:00
Bob Long 64fc60ce32 AP_HAL_SITL: initialize rcout safety state
This allows BRD_SAFETY_DEFLT=1 to work correctly for SITL.
2024-07-30 08:44:31 +10:00
Peter Barker f2ec97e4c7 autotest: correct Rover RangeFinder test
for reasons I can't fathom, defaulting the rangefinder state causes problems with the vehicle orientation in SITL - probably a state update fix somewhere.

This test was kind of broken anyway - the RangeFinder was pointing latterally out from the vehicle, but is displayed forward of the vehicle (ther RANGEFINDER mavlink message conveys no orientation information)
2024-07-30 08:42:42 +10:00
Peter Barker f60ecbfe4e autotest: disable PolyFenceObjectAvoidanceBendyRuler as it is unreliable ATM 2024-07-29 20:58:39 +10:00
Peter Barker 2245399ff9 autotest: tidy Rover autotests
autotest: tidy WheelEncoders test

autotest: rover: tidy PolyFenceObjectAvoidance code

autotest: add load_fence_using_mavwp

Also corrects the mission item types being returned by the mission-item-to-misison-item-int converter

autotest: fix Rover PolyFenceAvoidanceBendyRulerEasier test

these tests weren't being run becausethey were disabled based on support for loading fence items from QGC files.

autotest: fix Rover PolyFenceAvoidanceBendyRuler test
2024-07-29 20:58:39 +10:00
Peter Barker d7bc9a420f autotest: tracker; tidy GPSForYaw test 2024-07-29 20:58:39 +10:00
arynrosh 6dae760346 Tools: added name to GIT_Success.txt 2024-07-29 18:33:35 +10:00
Randy Mackay 2806f8b63b Plane: 4.5.5-beta2 release notes 2024-07-29 16:19:30 +10:00
Randy Mackay 8f51eafc82 Copter: 4.5.5-beta2 release notes 2024-07-29 15:18:17 +09:00
Randy Mackay b752f8d4cf Rover: 4.5.5-beta2 release notes 2024-07-29 15:18:15 +09:00
Randy Mackay 9f99d3c934 Tracker: 4.5.5-beta2 release notes 2024-07-29 15:18:11 +09:00
BLash d7ecf5fbc5 AP_ExternalAHRS_VectorNav: Consolidate EAH3 definition to single method
Resolve SITL failures due to multiply defined logger message by pulling the call to a single method
2024-07-29 15:52:29 +10:00
BLash 1d1bb5724e AP_ExternalAHRS_VectorNav: Address review comments
Remove unnecessary header
Switch parameters to default initialization
Change pointer casting to prevent a const_cast, and remove doubled sync byte when echoing ASCII messages
Fix Valgrind report by preventing use of nmea_printf on buffers which may not be null-terminated
2024-07-29 15:52:29 +10:00
BLash 50980ee03e AP_ExternalAHRS_VectorNav: Update SIM to match new message definitions
Redefine messages to 3 INS packets, and send as appropriate
Resolve SITL failures due to too-long logger message headers
2024-07-29 15:52:29 +10:00
BLash d4ca5fe868 AP_ExternalAHRS_VectorNav: Split IMU and EKF message
In AHRS Mode, split the single message to an IMU packet and an AHRS packet; in EKF Mode, split the two messages into an IMU message, an EKF packet, and a GNSS packet.
Simplify message header definition to consolidate and eliminate the need for static asserts
Update healthy logic and use to represent new packet structure
Replace EAH3 message with messages per-packet
Add Ypr as configured output in the EKF message
2024-07-29 15:52:29 +10:00
George Zogopoulos b5c91a1690 autotest: Converted parameter TKOFF_MODE to TKOFF_OPTIONS 2024-07-29 15:50:32 +10:00
George Zogopoulos e227187e72 AP_TECS: Converted parameter TKOFF_MODE to TKOFF_OPTIONS 2024-07-29 15:50:32 +10:00
George Zogopoulos c213ee2ef8 Plane: Converted paramter TKOFF_MODE into TKOFF_OPTIONS 2024-07-29 15:50:32 +10:00
George Zogopoulos 773c91cec1 ArduPlane: Added minimum throttle during TAKEOFF mode
This is a rework so that servos.cpp is responsible for setting the
throttle limits under more circumstances and always notifies TECS when
it does so.

Additionally, the TAKEOFF mode has been improved with a new parameters
TKOFF_MODE and TKOFF_THR_MIN that extend the throttle behaviour.
2024-07-29 15:50:32 +10:00
George Zogopoulos b163e13964 AP_TECS: Fixes to reset state
These concern the TAKEOFF flight stage and address #27147.

* Logging metadata fixes
* Disabled continuous TECS reset during takeoff
* Fixed bug in reached_speed_takeoff calculation
* Limited SPDWEIGHT=2 to only first part of takeoff climb
* _post_TO_hgt_offset set to constant
* Takeoff I-gain now defaults to 0 and is used
* Use at least TRIM_THROTTLE during the climb
* Updated description of TECS_TKOFF_IGAIN with new behaviour
* Forced max throttle while below TKOFF_LVL_ALT
* Added throttle constraints in no-airspeed mode

Additionally, set_min_throttle() has been created, that allows one to
set the minimum TECS throttle for the next update_pitch_throttle() loop.
Additionally, the throttle limits system has been reworked. TECS will
receive external throttle limits from Plane and will always take them
into account and respect them.
2024-07-29 15:50:32 +10:00
George Zogopoulos 1e6e291b52 autotest: New tests
Autotests for takeoffs have been added for Plane, covering AUTO and
TAKEOFF mode takeoffs.

An auxiliary `set_servo` method has been added to `vehicle_test_suite.py`.
2024-07-29 15:50:32 +10:00
Peter Barker eadc7c0ecc Tools: install_prereqs_ubuntu.sh: pin setuptools to avoid problems on Focal
focal:     return Version(version)
    focal:   File "/home/vagrant/.local/lib/python3.8/site-packages/packaging/version.py", line 202, in __init__
    focal:     raise InvalidVersion(f"Invalid version: '{version}'")
    focal: packaging.version.InvalidVersion: Invalid version: '1.0.3.linux-x86_64'
2024-07-29 15:27:23 +10:00
Peter Barker 07599ba570 Tools: environment_install: install Python packages one-at-a-time
helps to work out which packages are causing problems
2024-07-29 15:27:23 +10:00
cuav-chen2 3267b91160 bootloaders: Add CUAV-7-Nano bootloader 2024-07-29 12:25:53 +10:00
cuav-chen2 08c8ef379b HAL_ChibiOS: Added support for CUAV-7-Nano flight controller 2024-07-29 12:25:53 +10:00