def _thrust_monitor(self): # recalculate accumulated delta-v so far self.accumulated_delta_v = self._calculate_accumulated_delta_v() current_velocity = get_telemetry("orbitalVelocity") #print("Accumulated dV: {:.2f}".format(self.accumulated_delta_v)) #print("dV required: {:.2f}".format(self.delta_v_required)) #print("Velocity at start: {:.2f}".format(self.initial_speed)) #print("Current Velocity: {:.2f}".format(current_velocity)) #print("Expected dV at cutoff: {}".format(self.velocity_at_cutoff)) if current_velocity > (self.velocity_at_cutoff - 13.5) and not self._is_thrust_reduced: utils.log("Throttling back to 10%", log_level="DEBUG") telemachus.set_throttle(10) self._is_thrust_reduced = True telemachus.disable_smartass() telemachus.send_command_to_ksp("command=f.sas") if current_velocity > (self.velocity_at_cutoff - 3.5): # the 3.5 a hack otherwise it overshoots, FIXME! telemachus.cut_throttle() utils.log("Closing throttle, burn complete!", log_level="DEBUG") computer.dsky.current_verb.terminate() computer.execute_verb(verb="06", noun="14") computer.main_loop_table.remove(self._thrust_monitor) #computer.burn_complete() self.terminate() computer.go_to_poo()
def disable_direction_autopilot(self): """ Disables the directional autopilot :return: None """ telemachus.disable_smartass() self.is_direction_autopilot_engaged = False utils.log("Autopilot disabled", log_level="INFO")
def quit(self): """ Quits basaGC. :return: None """ # disables SMARTASS try: telemachus.disable_smartass() except TypeError: pass # if self.loop_timer.is_running: # self.loop_timer.stop() self.gui.Destroy()
def _disable_directional_autopilot(self): telemachus.disable_smartass() utils.log("Directional autopilot disabled", log_level="INFO") return True