def execute(self): """ Executes the program. :return: None """ super().execute() utils.log("Program 11 executing", log_level="INFO") # test if KSP is connected if check_connection() == False: return # --> call average G integration with ΔV integration # self.computer.run_average_g_routine = True # --> terminate gyrocompassing if "02" in self.computer.running_programs: self.computer.programs["02"].terminate() # --> compute initial state vector # self.computer.routines["average_g"]() # --> Display on DSKY: # --> V06 N62 (we are going to use V16N62 though, so we can have a updated display # --> R1: Velocity # --> R2: Rate of change of vehicle altitude # --> R3: Vehicle altitude in km to nearest .1 km self.computer.execute_verb(verb="16", noun="62")
def slow_loop(self): ''' A slower loop to handle tasks that are less frequently run :returns: ''' if not telemachus.check_connection(): self.dsky.annunciators["no_att"].on() if config.ENABLE_COMP_ACTY_FLASH: self.flash_comp_acty()
def on(self): ''' Turns the IMU on :returns: True if successful, False otherwise ''' if check_connection() == False: utils.log("Cannot connect to KSP", "WARNING") else: self.set_coarse_align()
def execute(self): """ Executes the program. :return: None """ super().execute() if check_connection() == False: Program.computer.poodoo_abort(111) self.terminate() return Program.computer.imu.on() self.timer.start(10000)
def set_fine_align(self): ''' Sets fine align mode. :returns: None ''' # if no connection to KSP, stop fine align and go back to coarse align if check_connection() == False: utils.log("IMU: cannot complete fine align, no connection to KSP", log_level="ERROR") return self.is_fine_aligned = True self.is_course_aligned = False self.computer.dsky.set_annunciator("gimbal_lock", False) self.computer.dsky.set_annunciator("no_att", False) #self.computer.main_loop_table.append(self.update_gyro_angles) #self.computer.main_loop_table.append(self.check_for_gimbal_lock) utils.log("IMU fine align set")
def execute(self): """ Entry point for the program :return: None """ super().execute() # if no connection to KSP, do P00DOO abort if not check_connection(): self.computer.poodoo_abort(111) self.terminate() return # check that orbital parameters are within range to conduct burn is_orbit_ok = maneuver.HohmannTransfer.check_orbital_parameters() if is_orbit_ok == True: # request mass self.computer.execute_verb(verb="21", noun="25") self.computer.dsky.request_data(requesting_object=self._accept_initial_mass_whole_part, display_location="data_1") else: self.computer.poodoo_abort(is_orbit_ok[1])
def execute(self): """ Entry point for the program :return: None """ super().execute() # if no connection to KSP, do P00DOO abort if not check_connection(): self.computer.poodoo_abort(111) self.terminate() return # check that orbital parameters are within range to conduct burn is_orbit_ok = maneuver.HohmannTransfer.check_orbital_parameters() if is_orbit_ok == True: # request mass self.computer.execute_verb(verb="21", noun="25") self.computer.dsky.request_data( requesting_object=self._accept_initial_mass_whole_part, display_location="data_1") else: self.computer.poodoo_abort(is_orbit_ok[1])