- //delete taxiRoute;
- //taxiRoute = new FGTaxiRoute;
- FGTaxiRoute tr = gn->findShortestRoute(node, runwayId);
- int route;
- FGTaxiNode *tn;
- waypoint *wpt;
- int nr = 0;
- cerr << "Creating taxiroute from gate: " << gateId << " at " << dep->getId() << endl;
- while (tr.next(&node, &route) && (nr++ < 3)) {
- char buffer[10];
- snprintf(buffer, 10, "%d", node);
- tn = dep->getDynamics()->getGroundNetwork()->findNode(node);
- wpt = createOnGround(ac, buffer, tn->getGeod(), dep->getElevation(),
- vTaxiReduced);
- wpt->routeIndex = route;
- waypoints.push_back(wpt);
- }
- wpt->name = "PushBackPoint";
- lastNodeVisited = tn->getIndex();
- //FGTaxiNode *firstNode = findNode(gateId);
- //FGTaxiNode *lastNode = findNode(runwayId);
- //cerr << "Creating direct forward departure route fragment" << endl;
- */
- double lat2 = 0.0, lon2 = 0.0, az2 = 0.0;
- waypoint *wpt;
- geo_direct_wgs_84 ( 0, lat, lon, heading,
- 2, &lat2, &lon2, &az2 );
- wpt = new waypoint;
- wpt->name = "park2";
- wpt->latitude = lat2;
- wpt->longitude = lon2;
- wpt->altitude = dep->getElevation();
- wpt->speed = vTaxiReduced;
- wpt->crossat = -10000;
- wpt->gear_down = true;
- wpt->flaps_down= true;
- wpt->finished = false;
- wpt->on_ground = true;
- wpt->routeIndex = 0;
- waypoints.push_back(wpt);
-
- geo_direct_wgs_84 ( 0, lat, lon, heading,
- 4, &lat2, &lon2, &az2 );
- wpt = new waypoint;
- wpt->name = "name";
- wpt->latitude = lat2;
- wpt->longitude = lon2;
- wpt->altitude = dep->getElevation();
- wpt->speed = vTaxiReduced;
- wpt->crossat = -10000;
- wpt->gear_down = true;
- wpt->flaps_down= true;
- wpt->finished = false;
- wpt->on_ground = true;
- wpt->routeIndex = 0;
- waypoints.push_back(wpt);
-
- //cerr << "Creating final push forward point for gate " << gateId << endl;
- FGTaxiNode *tn = dep->getDynamics()->getGroundNetwork()->findNode(gateId);
- FGTaxiSegmentVectorIterator ts = tn->getBeginRoute();
- FGTaxiSegmentVectorIterator te = tn->getEndRoute();
- if (ts == te) {
- SG_LOG(SG_GENERAL, SG_ALERT, "Gate " << gateId << "doesn't seem to have routes associated with it.");
- //exit(1);
- }
- tn = (*ts)->getEnd();
- lastNodeVisited = tn->getIndex();
- if (tn == NULL) {
- SG_LOG(SG_GENERAL, SG_ALERT, "No valid taxinode found");
- exit(1);
- }
- wpt = new waypoint;
- wpt->name = "PushBackPoint";
- wpt->latitude = tn->getLatitude();
- wpt->longitude = tn->getLongitude();
- wpt->altitude = dep->getElevation();
- wpt->speed = vTaxiReduced;
- wpt->crossat = -10000;
- wpt->gear_down = true;
- wpt->flaps_down= true;
- wpt->finished = false;
- wpt->on_ground = true;
- wpt->routeIndex = (*ts)->getIndex();
- waypoints.push_back(wpt);
- }
-