MechJeb2

MechJeb2

4M Downloads

A Death Loop In “CoastToDeceleration”

ceabie opened this issue · 2 comments

commented

OnFixedUpdate in CoastToDeceleration:
if currentError > 1000 && (!vesselState.parachuteDeployed || vesselState.drag <= 0.1) then switch to CourseCorrection.
In CourseCorrection:
if (vesselState.drag > 0.1) then switch to CoastToDeceleration.

Suppose now that currentError > 1000, parachuteDeployed = false and vesselState.drag > 0.21, it will be:
CoastToDeceleration(drag > 0.1) ->
CourseCorrection(currentError > 1000 && !parachuteDeployed is true) ->
CoastToDeceleration(drag > 0.1) ->
CourseCorrection(currentError > 1000 && !parachuteDeployed is true) ->
CoastToDeceleration(drag > 0.1) -> .....

Going to death loop until the currentError < 150 or is already too low.

commented

Thanks, it is working better!

commented

Thanks for finding it. That s the kind of bug that can be hard to trace.