-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
OA: hysteresis on failsafe #12109
OA: hysteresis on failsafe #12109
Conversation
5047aa8
to
23f49f1
Compare
It's unfortunate about the delay, but no matter what it is impossible for the setpoint to be sent to the companion and the companion to respond, guaranteed, before the next cycle. I'd like some feedback from @bresch about whether there might be a better way to do this, otherwise I think this needs to be merged to avoid getting failsafe warnings on modeswitch from position -> auto ie. without twitching. |
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.
Just a simple comment, otherwise it's okay for me.
d88cbde
to
84a10cb
Compare
Sorry, I clicked on the "update branch" and it did a merge of master into that branch. @mrivi could you rebase you branch and force push here again? You could also squash your two commits together at the same time. |
89f521b
to
941f5ff
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.
Perfect, tell me when you have the result of you test flights and we can merge if they are successful.
@mrivi Please link the result of the test here |
Scenarios that this PR is trying to fix:
You have a vehicle with a companion computer. You take off in PosControl and fly around. The companion doesn't receive any
vehicle_trajectory_waypoint_desired
because it isn't in a Auto Mode.Since the algorithm running on the companion always waits for the desired goal from the FCU, it's sending back (NAN, NAN, NAN) position and velocity setpoints. Since you are in PosControl and they don't get fused, your flight is fine.
As soon as you switch into a Auto Flight mode, those NAN setpoints get injected into the AutoMapper. This happens because there is a delay until the companion receives
vehicle_trajectory_waypoint_desired
, computes the changed setpoints and sends them back onvehicle_trajectory_waypoint
. The flight task failsafe will therefore kick in.How to fix it: on the companion side, if
(xy_pos_sp_valid || xy_vel_sp_valid) && (z_pos_sp_valid || z_vel_sp_valid)
the valid flagpoint_valid
is set to true otherwise is false.If
point_valid
is false, we don't overwrite the setpoints from the companion such that the FCU failsafe from the flight task doesn't kick in. Otherwise, if the point keeps not being valid for more than 500ms, the OA specific failsafe will kick in.Any other ideas on how to handle the delay with the companion when it isn't always computing a trajectory?