[rotorcraft] heading integration protection in RC-event #1174
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The PSI += .... was highly depending on the RC-frame rate.
With most RC this is not a problem but with variable message rates (e.g. rc_datalink dropping messages or joysticks sending too many frames) this line becomes dangerous.
So measure the time between to calls to read_rc_setpoint function instead of using a fixed RC_UPDATE_FREQ.
To prevent really weird things from happening, bound dt to 0.5s.
Don't partuculariliy like that this pulls in the sys_time dependency here,
but couldn't think of something better...
should close #452