""" # Generic Modules import time # In House Modules import alt_control # DONE (tentative - needs to be tested for all cases) import log_control # DONE (tested) import gps_control # DONE (tested) #import gps_control_testLibrary as gps_control import loiter_settings # TODO Madeline (need to change GPIO pin #) import flight_variables # DONE import thermocouple if __name__ == '__main__': # Initialize systems log_control.init_log_system() # Logging-system setup gps_control.init_gps_data() # Ensure we are getting GPS data thermocouple.checkThermo( ) # Make sure the thermocouple is getting reasonable data alt_control.init_coil_burner_system() # Coil-burner setup flight_variables.init_flags() # Flags for checking status # Start launch clocks: flight_variables.init_flight() # Begin Mission: while True: # Take data point log_control.take_data_point() # Check flags for Mission Complete / Mission Failed alt_control.check_status() # Respond to flags
dataFile.write("Mission Start Time: TBD WHEN WE GET A REAL CLOCK") # dataFile.write(str(gps_control.timeGet())) dataFile.write("\n----------------------------------") dataFile.write( "\n\nTimestamp\tAltitude (m)\tLatitude\tLongitude\tClimb (m/s)\tTemperature (C)\n" ) def take_data_point(): flightAlt = gps_control.altGet() flightTime = time.time() - flight_variables.launch_start flightLong = gps_control.lonGet() flightLat = gps_control.latGet() flightClimb = gps_control.climbGet() flightTemp = thermocouple.readThermo() dataMessage = '{} \t {} \t {} \t {} \t {} \t {} \n'.format( str(flightTime), str(flightAlt), str(flightLat), str(flightLong), str(flightClimb), str(flightTemp)) with open("dataLog.txt", "a") as dataFile: dataFile.write(dataMessage) # Testing this Module if __name__ == '__main__': gps_control.init_gps_data() init_log_system() time.sleep(3) with open("systemLog.txt", "a") as logFile: logFile.write("Testing the system...\n") take_data_point()