Main to burnout om kotwal(Continuation of PR #172) #174
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.
I accidentally started on a new branch, so sorry about that, but this PR addresses the problems within PR#172. I have modified the python version with some logical changes.
I added another timer(burnout_time_elapsed_with_sudden_acceleration_change) to the SustainerFSM class. This acts as the amount of time from the first time there is an abnormal acceleration change to the time it goes back to normal.
The logic is as follows:
If we have a normal acceleration that is below our threshold, we simply reset the timer.
However, if we have an abnormal acceleration and we haven't started the error timer yes. we start the timer.
When we check again later, if there is still an abnormal acceleration and the timer is going, we check if the delta is greater than our constant of 250 ms. If it is we transition back to the First Boost state.
Even though we have that timer, we still want to check if we need to transition into the next state of the sustainer ignition.
I have just added the changes for the Sustainer right now, but if the logic is approved, then I can easily add the changes to the booster, and then convert everything into C++ code.