-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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
Copter Fence Fixes #25875
Copter Fence Fixes #25875
Conversation
fb53b8b
to
67fdd74
Compare
67fdd74
to
e1534f5
Compare
e1534f5
to
451f738
Compare
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'd like @Hwurzburg to have a look at the impact on plane
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 think a few changes are needed: disabling floor on disarm for all autoenable values if the option is set...the impact of long continued breaching flight in plane must be either accepted by @tridge or changed.
This does fix some Plane bugs #1 and #2 and #4 if the change to when disable_floor is done:
1.AutoEnable on arming, or not using AutoEnabled, never disables a floor for landing. So all the Plane situations which think they disable floor, wont.
2.MIN_ALT floor always disabled on boot irrespective FENCE_ENABLE, never gets enabled unless: autoenabled, or overt enable(GCS or switch).
3.MIN_ALT fence records breach even if floor is not enabled. MIN_ALT breach is recorded but not cleared after landing, preventing mode changes if mode change prevention is enabled (Copter allows mode changes always). This prevents mode changes after landing.
4.MIN_ALT floor stays disabled after disable floor for landing, used by NAV_LAND, QLAND and other VTOL landings in Plane, LAND, Copter RTL
5.Plane automatically ignores ANY breach while performing a breach action. Again prevents mode changes in Plane while landed.
Just to try and capture what @rmackay9 would like - he would prefer that we auto-disable the floor fence as we go through it on a land/RTL action rather than leaving the fence enabled and ignoring it |
Trying to write down some rules here, as this stuff is convoluted ...
The current behaviour is confusing and inconsistent because sometimes all fences are automatically disabled to take an action when only the floor fence needs to be disabled, similarly current behaviour ignores breached floor fences in certain (landing) circumstances. In order to get consistency I think we need individual control over presence (OK), enablement (MISSING) and breaches (OK). This means turning the enabled flag into a bitmask. |
"Fence enablement (FENCE_ENABLE) means a fence is active and will take action if breached. We currently have no way of selectively enabling but I am beginning to think we should." is untrue Personally, I think:
|
_floor_enabled is not a parameter, so there is some indirect stuff going on, but nothing that allows you to directly enable or disable individual fences
Yes, 100% agree
Yes agree, auto enable of anything else seems a bit suspect to me
Yes, so this is not possible without finer grained control of enablement - bu I agree this is a good way forward
Agree about simplifying, still not quite sure what the correct mix is |
3fee4bd
to
014fa54
Compare
I have turned FENCE_ENABLE into a bitmask and it makes everything much easier. |
64e56a7
to
8034156
Compare
I think this is good, not recording an ALTMIN breach if not enabled....and having a configured ALT_MIN fence always autoenable (if not enabled by FENCE_ENABLE but configured in FENCE_TYPE) upon reaching the alt, and reenabling after a landing module disables it for landing if below the alt and a mode change occurs.....but we should also deprecate AutoEnable and convert "3" to setting a new FENCE_OPTIONS bit to enable all non MIN_ALT configured fences on arming, which would not be the default for the option bit |
3963290
to
34b5f35
Compare
here is another nasty one....Tridges patch fixes AUTOENABLE =2 operation, but AUTOENABLE =1 is broken still....first flight it will enable the poly on takeoff and breach and take breach action on the poly...but if you refly by restarting the mission, it will say that the poly fence has been enabled after takeoff, but not breach when it hits the poly....log :https://www.dropbox.com/scl/fi/1hdmsykaefv8yrhir92t9/00000003.BIN?rlkey=ajbgixqzzubbrby0wy5omvo9c&dl=0 |
@andyp1per @Hwurzburg this fixes the lastest issue that Henry found: |
I think we should mark FENCE_AUTOENABLE=1 and FENCE_AUTOENABLE=2 as deprecated, not actually remove them yet, but issue a deprecation warning, and recommend not using them in the wiki, instead pointing users at either FENCE_ENABLE=1 or FENCE_AUTOENABLE=3 |
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
7656c17
to
961e47e
Compare
5753aa6
to
8d7db72
Compare
I think these are all up for grabs, but would like to have that conversation after the PR goes in! |
another issue...if you have setup a fence sw, you cant autoenable any more and that includes min_alt....if you set it high on the ground you breach min_alt...if its low, then autoenable (at least 3) does not enable any fences....I would think at least on boot, the fence switch would allow autoenable if low....ie like fence_enable = 0. |
Yes - the switch should be "turn on fence function/turn off fence function" - when on, it should mean that fence functionality is on, (not that all fences turn on right away) - so autoenable will function if the switch is on, when off all fences are off and autoenable will not function. |
I was trying to be very conservative. It’s very easy for mavlink not to work. Also switch behaviour needs to be idempotent which makes it largely incompatible with auto enable.Andy Sent from my iPhoneOn 21 Jul 2024, at 18:46, Henry Wurzburg ***@***.***> wrote:
another issue...if you have setup a fence sw, you cant autoenable any more and that includes min_alt....if you set it high on the ground you breach min_alt...if its low, then autoenable (at least 3) does not enable any fences....I would think at least on boot, the fence switch would allow autoenable if low....ie like fence_enable = 0.
But i guess we could say that autoenable does not work if you have setup a fence sw.....I dont like it myself....I think that maybe we should change the fence sw init to do nothing and need a switch transition, or make the MIN_ALT work the same as in Autoenable...ie have to be above before enabling....anyway its very awkward now....
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Does it make sense If you think of the switch as "enable/disable Fence capability" rather than "enable/disable the actual fence"? |
I can't change the current meaning of what happens on a switch, the behaviour should be the same |
|
@andyp1per this PR makes the change to your PR as requested by @IamPete1 |
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
Merged thanks @tridge |
Separated out from #25698
Here is an attempt at describing what this is supposed to do:
Requires ArduPilot/mavlink#349