Skip to content
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

Merged
merged 1 commit into from
Jun 12, 2019
Merged

OA: hysteresis on failsafe #12109

merged 1 commit into from
Jun 12, 2019

Conversation

mrivi
Copy link
Contributor

@mrivi mrivi commented May 29, 2019

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 on vehicle_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 flag point_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?

@mrivi mrivi requested review from MaEtUgR, bresch and jkflying May 29, 2019 15:10
@mrivi mrivi force-pushed the companion_delay_fix branch from 5047aa8 to 23f49f1 Compare May 31, 2019 07:41
@jkflying
Copy link
Contributor

jkflying commented May 31, 2019

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.

bresch
bresch previously requested changes Jun 11, 2019
Copy link
Member

@bresch bresch left a 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.

@mrivi mrivi marked this pull request as ready for review June 11, 2019 17:14
@mrivi mrivi force-pushed the companion_delay_fix branch from d88cbde to 84a10cb Compare June 11, 2019 17:17
jkflying
jkflying previously approved these changes Jun 12, 2019
@jkflying jkflying dismissed bresch’s stale review June 12, 2019 07:25

requested changes applied

bresch
bresch previously approved these changes Jun 12, 2019
@bresch
Copy link
Member

bresch commented Jun 12, 2019

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.

@mrivi mrivi dismissed stale reviews from bresch and jkflying via 941f5ff June 12, 2019 07:55
@mrivi mrivi force-pushed the companion_delay_fix branch from 89f521b to 941f5ff Compare June 12, 2019 07:55
Copy link
Member

@bresch bresch left a 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.

@bresch bresch removed the request for review from MaEtUgR June 12, 2019 14:38
@bresch bresch merged commit 7a586d2 into master Jun 12, 2019
@bresch bresch deleted the companion_delay_fix branch June 12, 2019 14:42
@bresch
Copy link
Member

bresch commented Jun 12, 2019

@mrivi Please link the result of the test here

@mrivi
Copy link
Contributor Author

mrivi commented Jun 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants