[Gcblue-commits] gcb_wx/scripts AI.py,1.9,1.10
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-07-18 03:18:09
|
Update of /cvsroot/gcblue/gcb_wx/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11624/scripts Modified Files: AI.py Log Message: Index: AI.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/AI.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** AI.py 16 Feb 2004 01:06:22 -0000 1.9 --- AI.py 18 Jul 2004 03:18:00 -0000 1.10 *************** *** 155,179 **** return 0 def Land(UI,dest_id): # 0 - init, 1 - distant, 2 - init approach, 3 - final approach land_state = UI.GetVar(0) track_info = UI.GetTrackById(dest_id) if (track_info.ID == -1): UI.DisplayMessage('Invalid landing platform') UI.CompletedOrder() return # invalid id # adjust track location based on approach state if (land_state <= 1): if (land_state == 0): UI.DisplayMessage('Landing on platform %d' % track_info.ID) ! UI.SetAlt(1200) UI.SetVar(0,1) ! track_info.Offset(8, track_info.Heading_rad + 3.1416) # approach from rear for now elif (land_state == 2): ! track_info.Offset(5, track_info.Heading_rad + 3.1416) ! UI.SetAlt(400) UI.SetPitchLimit(15) elif (land_state == 3): ! UI.SetAlt(18) UI.SetPitchLimit(10) SetFractionalSpeed(UI,0.6) --- 155,194 ---- return 0 + # modified this to adjust altitude based on altitude of landing + # site def Land(UI,dest_id): # 0 - init, 1 - distant, 2 - init approach, 3 - final approach land_state = UI.GetVar(0) track_info = UI.GetTrackById(dest_id) + + alt_m = track_info.Alt if (track_info.ID == -1): + UI.DisplayMessage('Bad track ID for landing') + UI.CompletedOrder() + return # invalid id + + landing_data = UI.GetLandingData(dest_id) + if (landing_data.ID == -1): UI.DisplayMessage('Invalid landing platform') UI.CompletedOrder() return # invalid id + + track_info.Lat = landing_data.Lat + track_info.Lon = landing_data.Lon + track_info.Alt = landing_data.Alt + # adjust track location based on approach state if (land_state <= 1): if (land_state == 0): UI.DisplayMessage('Landing on platform %d' % track_info.ID) ! UI.SetAlt(1200 + alt_m) UI.SetVar(0,1) ! track_info.Offset(8, landing_data.Heading_rad + 3.1416) # approach from rear for now elif (land_state == 2): ! track_info.Offset(5, landing_data.Heading_rad + 3.1416) ! UI.SetAlt(400 + alt_m) UI.SetPitchLimit(15) elif (land_state == 3): ! UI.SetAlt(18 + alt_m) UI.SetPitchLimit(10) SetFractionalSpeed(UI,0.6) |