From 6245ecddcc7f2941bf63ea2302074b2fd1632c3e Mon Sep 17 00:00:00 2001 From: cs-powell <142438185+cs-powell@users.noreply.github.com> Date: Sat, 5 Apr 2025 18:18:21 -0400 Subject: [PATCH] landing complete --- Python3/src/cognitiveModel.py | 17 +++++++++++------ Python3/src/testPlatform.py | 3 --- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Python3/src/cognitiveModel.py b/Python3/src/cognitiveModel.py index f442e0d..3137e92 100644 --- a/Python3/src/cognitiveModel.py +++ b/Python3/src/cognitiveModel.py @@ -13,7 +13,7 @@ class scaleFactor(): SCALEYOKEPULL = 10 SCALEYOKESTEER = 10 SCALERUDDER = 10 - SCALELATITUDERUDDER = 0.02 + SCALELATITUDERUDDER = 0.001 SCALETHROTTLE = 1000 ###Define variables/parameters for aircraft class/category : Wisdom of Raju @@ -24,7 +24,7 @@ class AircraftLandingModel(pyactr.ACTRModel): self.inProgress = True self.printControlsFlag = printFlag self.targetLat = 39.895791 - self.targetLong = -104.696014 + self.targetLong = -104.696032 """ Setting DREF variables and loading into drefs array """ @@ -105,8 +105,8 @@ class AircraftLandingModel(pyactr.ACTRModel): self.target_airspeed = 80 self.target_roll = 0 self.target_heading = self.heading #Track heading from initialization[DEPRECATED] - self.target_Lat = self.latitude #Track Lat - self.target_Long = self.longitude #Track Long + self.target_Lat = 39.895791 + self.target_Long = -104.696032 self.target_descent_rate = 500 self.target_altitude = -998 self.target_pitch = 20 @@ -330,6 +330,9 @@ class AircraftLandingModel(pyactr.ACTRModel): #ORIGINAL # rudder, self.integral_heading = self.proportionalIntegralControl(0,self.dictionaryAccess(self.destinations,"heading"), self.target_heading, self.integral_heading,scaleFactor.SCALERUDDER) #lATITUDE/LONGITUDE + if(self.destinations,"longitude" == self.target_Long): + self.integral_Longitude = 0 + rudder, self.integral_Longitude = self.proportionalIntegralControl(0,self.dictionaryAccess(self.destinations,"longitude"), self.target_Long, self.integral_Longitude,scaleFactor.SCALELATITUDERUDDER) @@ -377,11 +380,13 @@ 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,rudder,throttle) #PRINT CONTROLS + self.printControls(1,0,yoke_pull,yoke_steer+additive,rudder,throttle) #PRINT CONTROLS # Send all controls simultaneously to X-Plane - self.send_controls_to_xplane(yoke_pull, yoke_steer, rudder, throttle) + self.send_controls_to_xplane(yoke_pull, yoke_steer+additive, rudder, throttle) def send_controls_to_xplane(self, yoke_pull, yoke_steer, rudder, throttle): diff --git a/Python3/src/testPlatform.py b/Python3/src/testPlatform.py index 63c1aeb..e516623 100644 --- a/Python3/src/testPlatform.py +++ b/Python3/src/testPlatform.py @@ -2,8 +2,6 @@ import datetime from math import cos, pi, sin, sqrt - - import os import time from time import sleep @@ -40,7 +38,6 @@ def loadFile(): return matrix - def selectWeather(matrix,experimentNumber): return matrix[experimentNumber]