1 /******************************************************************************
2 * AIFlightPlanCreate.cxx
3 * Written by Durk Talsma, started May, 2004.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of the
8 * License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 **************************************************************************/
20 #include "AIFlightPlan.hxx"
21 #include <simgear/math/sg_geodesy.hxx>
22 #include <Airports/runways.hxx>
24 #include <Environment/environment_mgr.hxx>
25 #include <Environment/environment.hxx>
28 /* FGAIFlightPlan::create()
29 * dynamically create a flight plan for AI traffic, based on data provided by the
30 * Traffic Manager, when reading a filed flightplan failes. (DT, 2004/07/10)
32 * This is the top-level function, and the only one that is publicly available.
37 // Check lat/lon values during initialization;
38 void FGAIFlightPlan::create(FGAirport *dep, FGAirport *arr, int legNr,
39 double alt, double speed, double latitude,
40 double longitude, bool firstFlight,double radius,
41 const string& fltType, const string& aircraftType,
42 const string& airline)
44 int currWpt = wpt_iterator - waypoints.begin();
48 createPushBack(firstFlight,dep, latitude, longitude,
49 radius, fltType, aircraftType, airline);
52 createTaxi(firstFlight, 1, dep, latitude, longitude,
53 radius, fltType, aircraftType, airline);
56 createTakeOff(firstFlight, dep, speed);
59 createClimb(firstFlight, dep, speed, alt);
62 createCruise(firstFlight, dep,arr, latitude, longitude, speed, alt);
71 createTaxi(false, 2, arr, latitude, longitude, radius,
72 fltType, aircraftType, airline);
75 createParking(arr, radius);
79 SG_LOG(SG_INPUT, SG_ALERT, "AIFlightPlan::create() attempting to create unknown leg"
80 " this is probably an internal program error");
82 wpt_iterator = waypoints.begin()+currWpt;
86 /*******************************************************************
88 * initialize the Aircraft at the parking location
89 ******************************************************************/
90 void FGAIFlightPlan::createPushBack(bool firstFlight, FGAirport *dep,
94 const string& fltType,
95 const string& aircraftType,
96 const string& airline)
105 //int currWpt = wpt_iterator - waypoints.begin();
106 // Erase all existing waypoints.
109 // We only need to get a valid parking if this is the first leg.
110 // Otherwise use the current aircraft position.
113 if (!(dep->getDynamics()->getAvailableParking(&lat, &lon,
116 aircraftType, airline)))
118 SG_LOG(SG_INPUT, SG_WARN, "Could not find parking for a " <<
120 " of flight type " << fltType <<
121 " of airline " << airline <<
122 " at airport " << dep->getId());
127 dep->getDynamics()->getParking(gateId, &lat, &lon, &heading);
132 waypoint *wpt = new waypoint;
135 wpt->longitude = lon;
136 wpt->altitude = dep->getElevation();
138 wpt->crossat = -10000;
139 wpt->gear_down = true;
140 wpt->flaps_down= true;
141 wpt->finished = false;
142 wpt->on_ground = true;
143 waypoints.push_back(wpt);
145 // Add park twice, because it uses park once for initialization and once
146 // to trigger the departure ATC message
147 geo_direct_wgs_84 ( 0, lat, lon, heading,
149 &lat2, &lon2, &az2 );
152 wpt->latitude = lat2;
153 wpt->longitude = lon2;
154 wpt->altitude = dep->getElevation();
156 wpt->crossat = -10000;
157 wpt->gear_down = true;
158 wpt->flaps_down= true;
159 wpt->finished = false;
160 wpt->on_ground = true;
161 waypoints.push_back(wpt);
162 geo_direct_wgs_84 ( 0, lat, lon, heading,
164 &lat2, &lon2, &az2 );
166 wpt->name = "taxiStart";
167 wpt->latitude = lat2;
168 wpt->longitude = lon2;
169 wpt->altitude = dep->getElevation();
171 wpt->crossat = -10000;
172 wpt->gear_down = true;
173 wpt->flaps_down= true;
174 wpt->finished = false;
175 wpt->on_ground = true;
176 waypoints.push_back(wpt);
179 /*******************************************************************
181 * initialize the Aircraft at the parking location
182 ******************************************************************/
183 void FGAIFlightPlan::createTaxi(bool firstFlight, int direction,
184 FGAirport *apt, double latitude, double longitude,
185 double radius, const string& fltType,
186 const string& acType, const string& airline)
192 double lat2, lon2, az2;
197 // If this function is called during initialization,
198 // make sure we obtain a valid gate ID first
199 // and place the model at the location of the gate.
202 if (!(apt->getDynamics()->getAvailableParking(&lat, &lon,
207 SG_LOG(SG_INPUT, SG_WARN, "Could not find parking for a " <<
209 " of flight type " << fltType <<
210 " of airline " << airline <<
211 " at airport " << apt->getId());
213 //waypoint *wpt = new waypoint;
214 //wpt->name = "park";
215 //wpt->latitude = lat;
216 //wpt->longitude = lon;
217 //wpt->altitude = apt->getElevation();
219 //wpt->crossat = -10000;
220 //wpt->gear_down = true;
221 //wpt->flaps_down= true;
222 //wpt->finished = false;
223 //wpt->on_ground = true;
224 //waypoints.push_back(wpt);
226 // "NOTE: this is currently fixed to "com" for commercial traffic
227 // Should be changed to be used dynamically to allow "gen" and "mil"
229 apt->getDynamics()->getActiveRunway("com", 1, activeRunway);
230 if (!(globals->get_runways()->search(apt->getId(),
234 SG_LOG(SG_INPUT, SG_ALERT, "Failed to find runway " <<
236 " at airport " << apt->getId());
240 // Determine the beginning of he runway
241 heading = rwy._heading;
242 double azimuth = heading + 180.0;
243 while ( azimuth >= 360.0 ) { azimuth -= 360.0; }
244 geo_direct_wgs_84 ( 0, rwy._lat, rwy._lon, azimuth,
245 rwy._length * SG_FEET_TO_METER * 0.5 - 5.0,
246 &lat2, &lon2, &az2 );
248 if (apt->getDynamics()->getGroundNetwork()->exists())
251 int runwayId = apt->getDynamics()->getGroundNetwork()->findNearestNode(lat2,
255 // A negative gateId indicates an overflow parking, use a
256 // fallback mechanism for this.
257 // Starting from gate 0 in this case is a bit of a hack
258 // which requires a more proper solution later on.
261 route = apt->getDynamics()->getGroundNetwork()->findShortestRoute(gateId,
264 route = apt->getDynamics()->getGroundNetwork()->findShortestRoute(0, runwayId);
268 //Add the runway startpoint;
270 wpt->name = "Airport Center";
271 wpt->latitude = latitude;
272 wpt->longitude = longitude;
273 wpt->altitude = apt->getElevation();
275 wpt->crossat = -10000;
276 wpt->gear_down = true;
277 wpt->flaps_down= true;
278 wpt->finished = false;
279 wpt->on_ground = true;
280 waypoints.push_back(wpt);
282 //Add the runway startpoint;
284 wpt->name = "Runway Takeoff";
285 wpt->latitude = lat2;
286 wpt->longitude = lon2;
287 wpt->altitude = apt->getElevation();
289 wpt->crossat = -10000;
290 wpt->gear_down = true;
291 wpt->flaps_down= true;
292 wpt->finished = false;
293 wpt->on_ground = true;
294 waypoints.push_back(wpt);
298 bool isPushBackPoint = false;
300 // If this is called during initialization, randomly
301 // skip a number of waypoints to get a more realistic
303 isPushBackPoint = true;
304 int nrWaypoints = route.size();
305 int nrWaypointsToSkip = rand() % nrWaypoints;
306 // but make sure we always keep two active waypoints
307 // to prevent a segmentation fault
308 for (int i = 0; i < nrWaypointsToSkip-2; i++) {
309 isPushBackPoint = false;
314 //chop off the first two waypoints, because
315 // those have already been created
316 // by create pushback
317 int size = route.size();
323 while(route.next(&node))
325 FGTaxiNode *tn = apt->getDynamics()->getGroundNetwork()->findNode(node);
328 wpt->name = "taxiway"; // fixme: should be the name of the taxiway
329 wpt->latitude = tn->getLatitude();
330 wpt->longitude = tn->getLongitude();
331 // Elevation is currently disregarded when on_ground is true
332 // because the AIModel obtains a periodic ground elevation estimate.
333 wpt->altitude = apt->getElevation();
334 if (isPushBackPoint) {
336 isPushBackPoint = false;
341 wpt->crossat = -10000;
342 wpt->gear_down = true;
343 wpt->flaps_down= true;
344 wpt->finished = false;
345 wpt->on_ground = true;
346 waypoints.push_back(wpt);
353 // This is the fallback mechanism, in case no ground network is available
354 //Add the runway startpoint;
356 wpt->name = "Airport Center";
357 wpt->latitude = apt->getLatitude();
358 wpt->longitude = apt->getLongitude();
359 wpt->altitude = apt->getElevation();
361 wpt->crossat = -10000;
362 wpt->gear_down = true;
363 wpt->flaps_down= true;
364 wpt->finished = false;
365 wpt->on_ground = true;
366 waypoints.push_back(wpt);
368 //Add the runway startpoint;
370 wpt->name = "Runway Takeoff";
371 wpt->latitude = lat2;
372 wpt->longitude = lon2;
373 wpt->altitude = apt->getElevation();
375 wpt->crossat = -10000;
376 wpt->gear_down = true;
377 wpt->flaps_down= true;
378 wpt->finished = false;
379 wpt->on_ground = true;
380 waypoints.push_back(wpt);
385 apt->getDynamics()->getAvailableParking(&lat, &lon, &heading,
386 &gateId, radius, fltType,
389 double lat3 = (*(waypoints.end()-1))->latitude;
390 double lon3 = (*(waypoints.end()-1))->longitude;
391 //cerr << (*(waypoints.end()-1))->name << endl;
393 // Find a route from runway end to parking/gate.
394 if (apt->getDynamics()->getGroundNetwork()->exists())
397 int runwayId = apt->getDynamics()->getGroundNetwork()->findNearestNode(lat3,
399 // A negative gateId indicates an overflow parking, use a
400 // fallback mechanism for this.
401 // Starting from gate 0 is a bit of a hack...
404 route = apt->getDynamics()->getGroundNetwork()->findShortestRoute(runwayId,
407 route = apt->getDynamics()->getGroundNetwork()->findShortestRoute(runwayId, 0);
410 // No route found: go from gate directly to runway
412 //Add the runway startpoint;
414 wpt->name = "Airport Center";
415 wpt->latitude = latitude;
416 wpt->longitude = longitude;
417 wpt->altitude = apt->getElevation();
419 wpt->crossat = -10000;
420 wpt->gear_down = true;
421 wpt->flaps_down= true;
422 wpt->finished = false;
423 wpt->on_ground = true;
424 waypoints.push_back(wpt);
426 //Add the runway startpoint;
428 wpt->name = "Runway Takeoff";
429 wpt->latitude = lat2;
430 wpt->longitude = lon2;
431 wpt->altitude = apt->getElevation();
433 wpt->crossat = -10000;
434 wpt->gear_down = true;
435 wpt->flaps_down= true;
436 wpt->finished = false;
437 wpt->on_ground = true;
438 waypoints.push_back(wpt);
442 int size = route.size();
443 // Omit the last two waypoints, as
444 // those are created by createParking()
445 for (int i = 0; i < size-2; i++)
448 FGTaxiNode *tn = apt->getDynamics()->getGroundNetwork()->findNode(node);
450 wpt->name = "taxiway"; // fixme: should be the name of the taxiway
451 wpt->latitude = tn->getLatitude();
452 wpt->longitude = tn->getLongitude();
453 wpt->altitude = apt->getElevation();
455 wpt->crossat = -10000;
456 wpt->gear_down = true;
457 wpt->flaps_down= true;
458 wpt->finished = false;
459 wpt->on_ground = true;
460 waypoints.push_back(wpt);
466 // Use a fallback mechanism in case no ground network is available
467 // obtain the location of the gate entrance point
471 geo_direct_wgs_84 ( 0, lat, lon, heading,
473 &lat2, &lon2, &az2 );
475 wpt->name = "Airport Center";
476 wpt->latitude = apt->getLatitude();
477 wpt->longitude = apt->getLongitude();
478 wpt->altitude = apt->getElevation();
480 wpt->crossat = -10000;
481 wpt->gear_down = true;
482 wpt->flaps_down= true;
483 wpt->finished = false;
484 wpt->on_ground = true;
485 waypoints.push_back(wpt);
488 wpt->name = "Begin Parking"; //apt->getId(); //wpt_node->getStringValue("name", "END");
489 wpt->latitude = lat2;
490 wpt->longitude = lon2;
491 wpt->altitude = apt->getElevation();
493 wpt->crossat = -10000;
494 wpt->gear_down = true;
495 wpt->flaps_down= true;
496 wpt->finished = false;
497 wpt->on_ground = true;
498 waypoints.push_back(wpt);
504 apt->getDynamics()->getParking(gateId, &lat, &lon, &heading);
510 wpt->name = "END"; //wpt_node->getStringValue("name", "END");
512 wpt->longitude = lon;
515 wpt->crossat = -10000;
516 wpt->gear_down = true;
517 wpt->flaps_down= true;
518 wpt->finished = false;
519 wpt->on_ground = true;
520 waypoints.push_back(wpt);
526 /*******************************************************************
528 * initialize the Aircraft at the parking location
529 ******************************************************************/
530 void FGAIFlightPlan::createTakeOff(bool firstFlight, FGAirport *apt, double speed)
536 double lat2, lon2, az2;
539 // Get the current active runway, based on code from David Luff
540 // This should actually be unified and extended to include
541 // Preferential runway use schema's
545 // "NOTE: this is currently fixed to "com" for commercial traffic
546 // Should be changed to be used dynamically to allow "gen" and "mil"
548 apt->getDynamics()->getActiveRunway("com", 1, activeRunway);
549 if (!(globals->get_runways()->search(apt->getId(),
553 SG_LOG(SG_INPUT, SG_ALERT, "Failed to find runway " <<
555 " at airport " << apt->getId());
559 heading = rwy._heading;
560 double azimuth = heading + 180.0;
561 while ( azimuth >= 360.0 ) { azimuth -= 360.0; }
562 geo_direct_wgs_84 ( 0, rwy._lat, rwy._lon, azimuth,
563 rwy._length * SG_FEET_TO_METER * 0.5 - 105.0,
564 &lat2, &lon2, &az2 );
567 wpt->latitude = lat2;
568 wpt->longitude = lon2;
569 wpt->altitude = apt->getElevation();
571 wpt->crossat = -10000;
572 wpt->gear_down = true;
573 wpt->flaps_down= true;
574 wpt->finished = false;
575 wpt->on_ground = true;
576 waypoints.push_back(wpt);
582 //Next: the Start of Climb
583 geo_direct_wgs_84 ( 0, lat, lon, heading,
584 2560 * SG_FEET_TO_METER,
585 &lat2, &lon2, &az2 );
589 wpt->latitude = lat2;
590 wpt->longitude = lon2;
591 wpt->altitude = apt->getElevation()+3000;
593 wpt->crossat = -10000;
594 wpt->gear_down = true;
595 wpt->flaps_down= true;
596 wpt->finished = false;
597 wpt->on_ground = false;
598 waypoints.push_back(wpt);
601 /*******************************************************************
603 * initialize the Aircraft at the parking location
604 ******************************************************************/
605 void FGAIFlightPlan::createClimb(bool firstFlight, FGAirport *apt, double speed, double alt)
612 double lat2, lon2, az2;
620 // "NOTE: this is currently fixed to "com" for commercial traffic
621 // Should be changed to be used dynamically to allow "gen" and "mil"
623 apt->getDynamics()->getActiveRunway("com", 1, activeRunway);
624 if (!(globals->get_runways()->search(apt->getId(),
628 SG_LOG(SG_INPUT, SG_ALERT, "Failed to find runway " <<
630 " at airport " << apt->getId());
636 heading = rwy._heading;
637 double azimuth = heading + 180.0;
638 while ( azimuth >= 360.0 ) { azimuth -= 360.0; }
639 cerr << "Creating climb at : " << rwy._id << " " << rwy._rwy_no << endl;
640 geo_direct_wgs_84 ( 0, rwy._lat, rwy._lon, heading,
642 &lat2, &lon2, &az2 );
644 wpt->name = "10000ft climb";
645 wpt->latitude = lat2;
646 wpt->longitude = lon2;
647 wpt->altitude = 10000;
649 wpt->crossat = -10000;
650 wpt->gear_down = true;
651 wpt->flaps_down= true;
652 wpt->finished = false;
653 wpt->on_ground = false;
654 waypoints.push_back(wpt);
657 geo_direct_wgs_84 ( 0, rwy._lat, rwy._lon, heading,
659 &lat2, &lon2, &az2 );
661 wpt->name = "18000ft climb";
662 wpt->latitude = lat2;
663 wpt->longitude = lon2;
664 wpt->altitude = 18000;
666 wpt->crossat = -10000;
667 wpt->gear_down = true;
668 wpt->flaps_down= true;
669 wpt->finished = false;
670 wpt->on_ground = false;
671 waypoints.push_back(wpt);
675 // /*******************************************************************
677 // * initialize the Aircraft at the parking location
678 // ******************************************************************/
679 // void FGAIFlightPlan::createCruise(bool firstFlight, FGAirport *dep,
680 // FGAirport *arr, double latitude,
681 // double longitude, double speed,
684 // double wind_speed;
685 // double wind_heading;
687 // double lat, lon, az;
688 // double lat2, lon2, az2;
692 // wpt = new waypoint;
693 // wpt->name = "Cruise"; //wpt_node->getStringValue("name", "END");
694 // wpt->latitude = latitude;
695 // wpt->longitude = longitude;
696 // wpt->altitude = alt;
697 // wpt->speed = speed;
698 // wpt->crossat = -10000;
699 // wpt->gear_down = false;
700 // wpt->flaps_down= false;
701 // wpt->finished = false;
702 // wpt->on_ground = false;
703 // waypoints.push_back(wpt);
706 // // should be changed dynamically to allow "gen" and "mil"
707 // arr->getDynamics()->getActiveRunway("com", 2, activeRunway);
708 // if (!(globals->get_runways()->search(arr->getId(),
712 // SG_LOG(SG_INPUT, SG_ALERT, "Failed to find runway " <<
714 // " at airport " << arr->getId());
717 // heading = rwy._heading;
718 // azimuth = heading + 180.0;
719 // while ( azimuth >= 360.0 ) { azimuth -= 360.0; }
722 // geo_direct_wgs_84 ( 0, rwy._lat, rwy._lon, azimuth,
724 // &lat2, &lon2, &az2 );
725 // wpt = new waypoint;
726 // wpt->name = "BOD";
727 // wpt->latitude = lat2;
728 // wpt->longitude = lon2;
729 // wpt->altitude = alt;
730 // wpt->speed = speed;
731 // wpt->crossat = alt;
732 // wpt->gear_down = false;
733 // wpt->flaps_down= false;
734 // wpt->finished = false;
735 // wpt->on_ground = false;
736 // waypoints.push_back(wpt);
739 /*******************************************************************
741 * initialize the Aircraft at the parking location
742 ******************************************************************/
743 void FGAIFlightPlan::createDecent(FGAirport *apt)
746 // Ten thousand ft. Slowing down to 240 kts
752 double lat2, lon2, az2;
757 //Beginning of Decent
759 // allow "mil" and "gen" as well
760 apt->getDynamics()->getActiveRunway("com", 2, activeRunway);
761 if (!(globals->get_runways()->search(apt->getId(),
765 SG_LOG(SG_INPUT, SG_ALERT, "Failed to find runway " <<
767 " at airport " << apt->getId());
771 heading = rwy._heading;
772 azimuth = heading + 180.0;
773 while ( azimuth >= 360.0 ) { azimuth -= 360.0; }
774 geo_direct_wgs_84 ( 0, rwy._lat, rwy._lon, azimuth,
776 &lat2, &lon2, &az2 );
779 wpt->name = "Dec 10000ft"; //wpt_node->getStringValue("name", "END");
780 wpt->latitude = lat2;
781 wpt->longitude = lon2;
782 wpt->altitude = apt->getElevation();
784 wpt->crossat = 10000;
785 wpt->gear_down = false;
786 wpt->flaps_down= false;
787 wpt->finished = false;
788 wpt->on_ground = false;
789 waypoints.push_back(wpt);
791 // Three thousand ft. Slowing down to 160 kts
792 geo_direct_wgs_84 ( 0, rwy._lat, rwy._lon, azimuth,
794 &lat2, &lon2, &az2 );
796 wpt->name = "DEC 3000ft"; //wpt_node->getStringValue("name", "END");
797 wpt->latitude = lat2;
798 wpt->longitude = lon2;
799 wpt->altitude = apt->getElevation();
802 wpt->gear_down = true;
803 wpt->flaps_down= true;
804 wpt->finished = false;
805 wpt->on_ground = false;
806 waypoints.push_back(wpt);
808 /*******************************************************************
810 * initialize the Aircraft at the parking location
811 ******************************************************************/
812 void FGAIFlightPlan::createLanding(FGAirport *apt)
814 // Ten thousand ft. Slowing down to 150 kts
820 double lat2, lon2, az2;
826 heading = rwy._heading;
827 azimuth = heading + 180.0;
828 while ( azimuth >= 360.0 ) { azimuth -= 360.0; }
831 geo_direct_wgs_84 ( 0, rwy._lat, rwy._lon, azimuth,
832 rwy._length*0.45 * SG_FEET_TO_METER,
833 &lat2, &lon2, &az2 );
835 wpt->name = "Threshold"; //wpt_node->getStringValue("name", "END");
836 wpt->latitude = lat2;
837 wpt->longitude = lon2;
838 wpt->altitude = apt->getElevation();
840 wpt->crossat = apt->getElevation();
841 wpt->gear_down = true;
842 wpt->flaps_down= true;
843 wpt->finished = false;
844 wpt->on_ground = true;
845 waypoints.push_back(wpt);
847 //Full stop at the runway centerpoint
848 geo_direct_wgs_84 ( 0, rwy._lat, rwy._lon, azimuth,
850 &lat2, &lon2, &az2 );
852 wpt->name = "Center"; //wpt_node->getStringValue("name", "END");
853 wpt->latitude = rwy._lat;
854 wpt->longitude = rwy._lon;
855 wpt->altitude = apt->getElevation();
857 wpt->crossat = -10000;
858 wpt->gear_down = true;
859 wpt->flaps_down= true;
860 wpt->finished = false;
861 wpt->on_ground = true;
862 waypoints.push_back(wpt);
864 geo_direct_wgs_84 ( 0, rwy._lat, rwy._lon, heading,
865 rwy._length*0.45 * SG_FEET_TO_METER,
866 &lat2, &lon2, &az2 );
868 wpt->name = "Threshold"; //wpt_node->getStringValue("name", "END");
869 wpt->latitude = lat2;
870 wpt->longitude = lon2;
871 wpt->altitude = apt->getElevation();
873 wpt->crossat = apt->getElevation();
874 wpt->gear_down = true;
875 wpt->flaps_down= true;
876 wpt->finished = false;
877 wpt->on_ground = true;
878 waypoints.push_back(wpt);
881 /*******************************************************************
883 * initialize the Aircraft at the parking location
884 ******************************************************************/
885 void FGAIFlightPlan::createParking(FGAirport *apt, double radius)
892 apt->getDynamics()->getParking(gateId, &lat, &lon, &heading);
896 geo_direct_wgs_84 ( 0, lat, lon, heading,
898 &lat2, &lon2, &az2 );
900 wpt->name = "taxiStart";
901 wpt->latitude = lat2;
902 wpt->longitude = lon2;
903 wpt->altitude = apt->getElevation();
905 wpt->crossat = -10000;
906 wpt->gear_down = true;
907 wpt->flaps_down= true;
908 wpt->finished = false;
909 wpt->on_ground = true;
910 waypoints.push_back(wpt);
911 geo_direct_wgs_84 ( 0, lat, lon, heading,
913 &lat2, &lon2, &az2 );
915 wpt->name = "taxiStart";
916 wpt->latitude = lat2;
917 wpt->longitude = lon2;
918 wpt->altitude = apt->getElevation();
920 wpt->crossat = -10000;
921 wpt->gear_down = true;
922 wpt->flaps_down= true;
923 wpt->finished = false;
924 wpt->on_ground = true;
925 waypoints.push_back(wpt);
928 wpt->name = "END"; //wpt_node->getStringValue("name", "END");
930 wpt->longitude = lon;
931 wpt->altitude = apt->getElevation();
933 wpt->crossat = -10000;
934 wpt->gear_down = true;
935 wpt->flaps_down= true;
936 wpt->finished = false;
937 wpt->on_ground = true;
938 waypoints.push_back(wpt);