GliderGeek/opensoar

Thermal/cruise state machine appears to have no state change from PossibleCruise back to Climb

Closed this issue · 4 comments

I've distilled this state diagram from your code, please check if this is roughly correct.
opensoar_thermal_detection

I don't really see a state transition from PossibleCruise to Climb. You do check the transition to Cruise (when 1km has been cruised), but I see no place where cruise is set to False

I find it difficult to interpret the diagram, but there is indeed a certain a-symmetry between cruise -> thermal and thermal -> cruise. the transition cruise -> thermal contains refinement.

from cruise -> thermal

  • 225 degree continuous turn
  • thermal start at first occurrence of >4deg/s or at start of turn

from thermal -> cruise

  • absolute always <4deg/s, cruise distance > 1000m, average < 2 deg/s.

Looking again at the diagram:

  • When in 'cruise' state, it is also in 'possible climb' state. If the bearing change sign changes (e.g. from cw to ccw), the 'possible climb' entry is updated and cumulative bearing change is reset.

In terms of arrows:

  • PossibleClimb -> Climb takes place when ccw changes to cw and vice versa
  • Climb -> PossibleClimb always takes place

btw, to specifically answer the question on the state change between possible cruise and climb:
this happens on line 72:
possible_cruise_start = None

I see, thanks!