diff --git a/Python3/src/cognitiveModel.py b/Python3/src/cognitiveModel.py index fb2ab4c..994c8e8 100644 --- a/Python3/src/cognitiveModel.py +++ b/Python3/src/cognitiveModel.py @@ -380,8 +380,8 @@ class AircraftLandingModel(pyactr.ACTRModel): ##Method 2: Same Control Statements with Change in Parameter to decided pitch from Airspeed ---> Local Pitch Relative to the Horizon rudder = rudder * -1 - additive = rudder*1.0 + #Switch Target for Pitch to Local Pitch Axis (ex. +10 Degrees nose up) if(self.printControlsFlag): self.printControls(1,0,yoke_pull,yoke_steer+additive,rudder,throttle) #PRINT CONTROLS diff --git a/Python3/src/experiments/weather_files/turbulence.csv b/Python3/src/experiments/weather_files/turbulence.csv new file mode 100644 index 0000000..5a2870a --- /dev/null +++ b/Python3/src/experiments/weather_files/turbulence.csv @@ -0,0 +1,11 @@ +Turbulence Experiments,Starting Altitude (AGL),Wind Layer Altitude,Wind Direction,Wind Speed,Turbulence,Thermal Rate,Thermal Percent,Thermal Altitude +0,2900,0,179,0,1,500,0.9,15000 +1,2900,0,179,0,2,500,0.9,15000 +2,2900,0,179,0,3,500,0.9,15000 +3,2900,0,179,0,4,500,0.9,15000 +4,2900,0,179,0,5,500,0.9,15000 +5,2900,0,179,0,6,500,0.9,15000 +6,2900,0,179,0,7,500,0.9,15000 +7,2900,0,179,0,8,500,0.9,15000 +8,2900,0,179,0,9,500,0.9,15000 +9,2900,0,179,0,10,500,0.9,15000 diff --git a/Python3/src/testPlatform.py b/Python3/src/testPlatform.py index 45c5895..bccb74e 100644 --- a/Python3/src/testPlatform.py +++ b/Python3/src/testPlatform.py @@ -36,6 +36,7 @@ def eulerToQuat(psiInput,thetaInput,phiInput): def loadFile(): filename = "Python3/src/experiments/weather_files/weather.csv" + filename = "Python3/src/experiments/weather_files/turbulence.csv" with open(filename,"r") as f: matrix = list(csv.reader(f,delimiter=',')) print(matrix) @@ -115,13 +116,26 @@ def experimentSetUp(client,currentConditions,newExperiment): # client.sendDREF(windLayer2,15000) # client.sendDREF(windLayer3,15000) print("Setting Wind Direction and Speed") - client.sendDREF(windDirection,float(currentConditions[3])) print("Set 1") client.sendDREF(windSpeed,float(currentConditions[4])) print("Set 2") + print("Setting Turbulence Level") + turbulenceDREF = "sim/weather/turbulence[0]" + client.sendDREF(turbulenceDREF,float(currentConditions[5])) + + print("Setting Thermals") + thermalRateDREF = "sim/weather/thermal_rate_ms" + thermalPercentDREF = "sim/weather/thermal_percent" + thermalAltitudeDREF = "sim/weather/thermal_altitude_msl_m" + client.sendDREF(thermalRateDREF,float(currentConditions[6])) + client.sendDREF(thermalPercentDREF,float(currentConditions[7])) + client.sendDREF(thermalAltitudeDREF,float(currentConditions[8])) + + + # client.sendDREF(turbulence,turbulencePercentage) # preset = "sim/weather/region/weather_preset" # value = 8 @@ -146,10 +160,19 @@ def experimentSetUp(client,currentConditions,newExperiment): 20 - Latitude and Longitude """ message = "Conditions are set as\n" \ + "Experiment #: {} \n"\ "Starting Altitude: {} \n" \ "Layer Altitude: {} \n" \ "Wind Direction: {} \n" \ - "Wind Speed: {} \n".format(currentConditions[1],currentConditions[2],currentConditions[3],currentConditions[4]) + "Wind Speed: {} \n" \ + "Turbulence: {} \n" \ + "Thermal Rate: {} \n" \ + "Thermal Percent: {}\n" \ + "Thermal Altitude: {}\n".format(currentConditions[0],currentConditions[1],currentConditions[2],currentConditions[3],currentConditions[4], + currentConditions[5],currentConditions[6],currentConditions[7],currentConditions[8]) + + + specialPrint(message,False,messageType.REGULAR) else: print("Experiment currently in progress, not resetting position and environmental conditions") @@ -292,7 +315,7 @@ def setUp(): def cleanUp(count,title): now = datetime.datetime # shutil.copy("/Users/flyingtopher/X-Plane 11/Data.txt", "/Users/flyingtopher/Desktop/Test Destination/" + title + "_"+ count + "_" + str(now.now()) + "_" + ".txt") - shutil.copy("/Users/flyingtopher/X-Plane 11/Data.txt", "/Users/flyingtopher/Desktop/Test Destination/" + title + "_"+ str(count) + "_" + ".txt") + shutil.copy("/Users/flyingtopher/X-Plane 11/Data.txt", "/Users/flyingtopher/Desktop/Test Destination/Current Experiment/" + title + "_"+ str(count) + "_" + ".txt") print("CLEAN UP: Data File Deleted and Reset") specialPrint("Data File Ready",False,messageType.REGULAR) @@ -343,6 +366,9 @@ def ex(): """ End of Experiments """ + now = datetime.datetime + ##Adding something to copy all the battery files into a safe folder so they don't get overwritten + shutil.copytree("/Users/flyingtopher/Desktop/Test Destination/Current Experiment", ("/Users/flyingtopher/Desktop/Test Destination/Data Storage/" + str(now.now())), dirs_exist_ok=True) specialPrint("Experiment Battery Complete", False,messageType.REGULAR)