-
Notifications
You must be signed in to change notification settings - Fork 16.8k
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
Stop Plane flying away in avoidance recovery (instead of loitering) #15063
Stop Plane flying away in avoidance recovery (instead of loitering) #15063
Conversation
|
Closes #15028 |
... this also leaves the default behaviour as "fly away 10km". |
I have only tested this in SITL. It switched modes to loiter when the recovery action was set appropriately. It also stopped |
This is definitely better. There is another problem however with a stationary threat - when resuming into loiter, the aircraft turns and goes back onto a collision course and this triggers the avoidance again. In this example it eventually led to flying around the stationary threat at a distance of approximately AVD_F_DIST_XY - using the following parameters. AVD_ENABLE 1.000000 |
@peterbarker I remember you and I testing this a lot back when it first went in. Perhaps we should look back at the initial implementations to see how this was handled |
On Mon, 17 Aug 2020, Samuel Tabor wrote:
This is definitely better. There is another problem however with a stationary threat - when resuming into loiter, the aircraft turns and goes back onto a
collision course and this triggers the avoidance again. In this example it eventually led to flying around the stationary threat at a distance of
approximately AVD_F_DIST_XY - using the following parameters.
Yeah, I was afraid that might happen :-/
The other solution was to extrapolate that guided waypoint a little less.
I like that because it makes me really uneasy having any state like that
just lying around in the autopilot.
Any suggestions on how we might project the guided waypoint a
*sensible* amount?
Has to account for really high winds (tail and head), really low airspeeds
and really fast airspeeds.
tridge agreed we should change the default recovery behaviour, BTW - i.e.
"stay in avoidance" should actually loiter...
|
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 fixes the fly-away type behavior but what we need is some hysteresis (short timer?) so we don't toggle back and forth in/out of the avoid as we leave the radius and then re-enter. For the sake of things.. I suggest we merge this as-is because it fixes a critical fly-away bug and make a new PR to change the behavior of the algorithm re-entry issue
How about grab airspeed and project it 10 seconds away |
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.
Per the DevCall meeting decision, we should change the logic from fixed 10k distance offset to a point that is 0.5*loiter_radius away from the obstacle keep-out boundary.
I think to fix this would need -
|
@samuelctabor yeah, 1x the loiter radius. In my head when I wrote that I was thinking diameter for some weird reason. A buffer is a good idea but it should be minimal. How about 1 second of flight per ARSPD_TRIM_CM. I either don't understand or totally disagree with the second part. The param is there as a user-defined keep-out zone. Why would we not use it? It's always being computed anyway |
I talked to @samuelctabor and it was he who was not understanding :) I'll let him clarify. |
We're on the same page now I think, I was talking about placing the loiter point a distance from the obstacle itself, you were talking about distance a from the position where AVOID_ADSB is triggered. |
2fee1f2
to
4e2e37e
Compare
The behaviour seems similar to before when avoiding a stationary threat - rapid switching between LOITER and ADSB forming a circle around the obstacle. The radius it is teetering on is about 1300m so somewhat larger than AVD_F_DIST_XY. This time the parameters were: AVD_F_ACTION 3.000000 I haven't looked at the code but I think what happens is this. It places the target point correctly during AVOID_ADSB, but then as soon as it turns to head to this point the trajectory no longer intersects the obstacle so it recovers to LOITER. Then, it starts turning, making the trajectory intersect the obstacle again and triggers AVOID_ADSB. If this is correct either it needs to;
|
4e2e37e
to
7f3d385
Compare
I really think we need to put this in unless somebody has time to really work on the at-DevCall-proposed solution. I've just added a test which came up as part of a patch which also touches the existing avoidance code. This is what happens on master with the test which is now attached to this PR: I have no reason to suspect that Plane won't keep flying for a very, very long time. ... and this is post-this-PR: |
7f3d385
to
0bc8b9b
Compare
Currently this waypoint is set 10,000m away by the avoidance behaviour Instead, immediately enter loiter mode
0bc8b9b
to
c046cc5
Compare
No description provided.