Commit Graph

64104 Commits

Author SHA1 Message Date
Peter Barker 1afa801b19 AP_LTM_Telem: correct compilation with AP_RRSI_ENABLED false
Co-authored-by: David Buzz <davidbuzz@gmail.com>
2024-07-24 09:11:39 +10:00
Andrew Tridgell a371a3eb89 Copter: fully honour FENCE_OPTION to disable mode changes
when the user has chosen to disallow mode change during fence breach
it should be fully implemented, without a landing exception.

as requested by Pete, and discussed on dev call
2024-07-24 08:24:06 +10:00
Andy Piper f8e5c7c1c4 Plane: address minor review comments 2024-07-24 08:24:06 +10:00
Andy Piper 51304848fc Copter: address minor review comments 2024-07-24 08:24:06 +10:00
Andy Piper ccfbfddf7e AC_Fence: address minor review comments 2024-07-24 08:24:06 +10:00
Andy Piper 55075961b2 AP_Mission: address minor review comments 2024-07-24 08:24:06 +10:00
Andrew Tridgell d845af9bc3 Plane: fixed re-enable of fence for FENCE_AUTOENABLE=1
the is an adjustment to the previous fix which only worked when we had
at least one fence element enabled when we were not flying or disarmed
2024-07-24 08:24:06 +10:00
Andy Piper 0b6a1f4fe7 autotest: test for circle exclusion fence using AUTOENABLE=2 2024-07-24 08:24:06 +10:00
Andrew Tridgell 5d46e0c64e Plane: reset previous mode fence breach when disarmed
when we are disarmed or we are not in fence breach and we are not
flying then reset the previous mode fence reason state so that a new
flight will get the correct fence breach action behaviour
2024-07-24 08:24:06 +10:00
Andrew Tridgell 68f2593089 AC_Fence: fixed FENCE_AUTOENABLE=2
needs to auto-enable on takeoff complete
2024-07-24 08:24:06 +10:00
Andy Piper e4f76cd27d Plane: reject guided destinations outside the fence 2024-07-24 08:24:06 +10:00
Andy Piper 2877472f27 Copter: support FENCE_OPTIONS on copter 2024-07-24 08:24:06 +10:00
Andy Piper 5bc3727145 AC_Fence: support FENCE_OPTIONS on copter 2024-07-24 08:24:06 +10:00
Andy Piper c40b80b100 Copter: don't print fence cleared messages when sitting on the ground 2024-07-24 08:24:06 +10:00
Andy Piper e4cbee133b Plane: only disable fences when in landing phase 2024-07-24 08:24:06 +10:00
Andy Piper 8c0c84b7ab Copter: only disable fences when in landing phase 2024-07-24 08:24:06 +10:00
Andy Piper b7ce3ff286 autotest: add test for minimum altitude avoidance fence 2024-07-24 08:24:06 +10:00
Andy Piper 29a320b310 AC_Avoidance: correctly set back away speed for minimum alt fences 2024-07-24 08:24:06 +10:00
Andy Piper e30dc2c536 autotest: fix fence autotests
add Plane.FenceMinAltEnableAutoland
test that vehicle can be landed manually after descending below fence floor
2024-07-24 08:24:06 +10:00
Andy Piper f8304e12d1 Copter: don't breach auto-fences when landed 2024-07-24 08:24:06 +10:00
Andy Piper 37e0923ec2 AP_Arming: allow precise wording of fence pre-arm messages 2024-07-24 08:24:06 +10:00
Andy Piper f0456f29dd AC_Fence: always disable Min Alt fence on landing
allow precise pre-arm messages
2024-07-24 08:24:06 +10:00
Andy Piper 685fb7e34f Rover: use generic fence handling in missions 2024-07-24 08:24:06 +10:00
Andy Piper 823ffb6c9e Copter: use generic fence handling in missions 2024-07-24 08:24:06 +10:00
Andy Piper a11cc6ea66 Plane: use generic fence handling in missions 2024-07-24 08:24:06 +10:00
Andy Piper 255fac215f AP_Mission: generic fence handling in missions 2024-07-24 08:24:06 +10:00
Andy Piper eaf001c52f Copter: disable fences for landing by suppressing in the fence check rather than using a state machine 2024-07-24 08:24:06 +10:00
Andy Piper 46d6d0bf03 Plane: disable fences for landing by suppressing in the fence check rather than using a state machine 2024-07-24 08:24:06 +10:00
Andy Piper 04dd7de1ed AC_Fence: disable fences for landing by suppressing in the fence check rather than using a state machine
simplify takeoff auto-enablement
2024-07-24 08:24:06 +10:00
Andy Piper c216536a94 autotest: test aborted landing with fence correctly 2024-07-24 08:24:06 +10:00
Andy Piper ee7742ac40 Plane: use reset_fence_floor_enable() 2024-07-24 08:24:06 +10:00
Andy Piper d5c6f3fe06 AC_Fence: add reset_fence_floor_enable() and use it in plane when landing is aborted 2024-07-24 08:24:06 +10:00
Andy Piper cedccdb8fe autotest: add test for auto-disabling min alt fence breaches on disarming
clean-up fence manipulation functions and add test for auto-enablement on copter
update tests to have some FENCE_ENABLE tests
add avoidance minimum and maximum altitude fence
add fence switch test while flying
add FenceAutoEnableDisableSwitch for auto mode 2
add more scenarios for plane fence auto-enable
validate fence rc switch behaviour
check fence autoenable by taking off in guided mode
more FENCE_AUTOENABLE tests
add FenceEnableDisableAux and FenceMinAltAutoEnableAbort
2024-07-24 08:24:06 +10:00
Peter Barker a4c7819117 AC_Fence: clear breach of disabled fence
skip breach checks if no fences
correct initialisation of _num_fences in the case of no fences in eeprom
2024-07-24 08:24:06 +10:00
Andy Piper 3fabec4158 AP_Arming: ensure fence enablement on arming is inverted on disarming 2024-07-24 08:24:06 +10:00
Andy Piper 174d5f07bb AC_Fence: ensure fence enablement on arming is inverted on disarming
correct detection of polyfence
2024-07-24 08:24:06 +10:00
Andy Piper f0f8187c7f AC_Fence: add ability to auto-enable fence floor while doing fence checks
control copter floor fence with autoenable
autoenable floor fence with a margin
check for manual recovery only after having checked the fences
make auto-disabling for minimum altitude fence an option
output message when fence floor auto-enabled
re-use fence floor auto-enable/disable from plane
auto-disable on landing
do not update enable parameter when controlling through mavlink
make sure get_enabled_fences() actually returns enabled fences.
make current fences enabled internal state rather than persistent
implement auto options correctly and on copter
add fence names utility
use ExpandingString for constructing fence names
correctly check whether fences are enabled or not and disable min alt for landing in all auto modes
add enable_configured() for use by mavlink and rc
add events for all fence types
make sure that auto fences are no longer candidates after manual updates
add fence debug
make sure rc switch is the ultimate authority on fences
reset auto mask when enabling or disabling fencing
ensure auto-enable on arming works as intended
simplify printing fence notices
reset autofences when auot-enablement is changed
2024-07-24 08:24:06 +10:00
Andy Piper 370b0d7b9c AP_Logger: add events for all fence types 2024-07-24 08:24:06 +10:00
Henry Wurzburg a6300e35d0 Plane: prevent Mode Takeoff calling fence autoenable more than once 2024-07-24 08:24:06 +10:00
Andy Piper 4fc59ae67d Rover: use fence enable_configured() 2024-07-24 08:24:06 +10:00
Andy Piper 559bd1e252 Plane: use fence enable_configured()
avoid fence breach clearing spam
2024-07-24 08:24:06 +10:00
Andy Piper 0288e1e79c RC_Channel: use fence enable_configured() 2024-07-24 08:24:06 +10:00
Andy Piper d16615923d AP_Frsky_Telem: use fence enable_configured() 2024-07-24 08:24:06 +10:00
Andy Piper 0c6ea4790d AP_Common: fix initialization of ExpandingString so that it can be used on the stack
zero out passed in buffers for ExpandingString
2024-07-24 08:24:06 +10:00
Andy Piper 8c2f686bfa Plane: output user-friendly fence messages 2024-07-24 08:24:06 +10:00
Andy Piper 3dbcbe0026 AP_Arming: do not enable minimim altitude fence on arming
call appropriate fence method for auto-enablement
2024-07-24 08:24:06 +10:00
Andy Piper 8287d4f2d0 AC_Avoidance: take into account minimum altitude fence when calculating climb rate 2024-07-24 08:24:06 +10:00
Andy Piper 95b39f64e3 AP_Mission: add comment about new fence API 2024-07-24 08:24:06 +10:00
Andy Piper f73154349b GCS_MAVLink: use bitmask based enablement for fences 2024-07-24 08:24:06 +10:00
Andy Piper 738586342c Copter: notify when fence breach has cleared
output fence breach type
when switching mode without a fence action do not go into manual recovery
only recover if there is a fence action
implement auto-takeoff fence options
output user-friendly fence names
auto-enable fences on auto-takeoff
use fence enable_configured()
simplify message printing
2024-07-24 08:24:06 +10:00