def _begin_burn(self): self.initial_speed = get_telemetry("orbitalVelocity") # start thrusting telemachus.set_throttle(100) gc.main_loop_table.append(self._thrust_monitor)
def _thrust_monitor(self): # recalculate accumulated delta-v so far self.accumulated_delta_v = self._calculate_accumulated_delta_v() if self.accumulated_delta_v > (self.delta_v_required - 10) and not self._is_thrust_reduced: utils.log("Throttling back to 10%", log_level="DEBUG") telemachus.set_throttle(10) self._is_thrust_reduced = True if self.accumulated_delta_v > (self.delta_v_required - 0.5): telemachus.cut_throttle() utils.log("Closing throttle, burn complete!", log_level="DEBUG") gc.dsky.current_verb.terminate() gc.execute_verb(verb="06", noun="14") gc.main_loop_table.remove(self._thrust_monitor) gc.burn_complete() self.terminate() gc.go_to_poo()