49 const string& fltType,
50 const string& aircraftType,
51 const string& airline)
54 double vTaxiBackward = vTaxi * (-2.0/3.0);
55 double vTaxiReduced = vTaxi * (2.0/3.0);
61 if (!(dep->
getDynamics()->getGroundController()->exists())) {
63 SG_LOG(SG_AI, SG_DEV_WARN,
"No groundcontroller createPushBackFallBack at " << dep->
getId());
64 createPushBackFallBack(ac, firstFlight, dep,
65 radius, fltType, aircraftType, airline);
69 if (firstFlight || !dep->
getDynamics()->hasParking(gate.parking())) {
76 gate = dep->
getDynamics()->getAvailableParking(radius, fltType,
77 aircraftType, airline);
78 if (!gate.isValid()) {
79 SG_LOG(SG_AI, SG_DEV_WARN,
"Could not find parking for a " <<
81 " of flight type " << fltType <<
82 " of airline " << airline <<
83 " at airport " << dep->
getId());
89 if (!gate.isValid()) {
90 SG_LOG(SG_AI, SG_DEV_WARN,
"Gate " << gate.parking()->ident() <<
" not valid createPushBackFallBack at " << dep->
getId());
91 createPushBackFallBack(ac, firstFlight, dep,
92 radius, fltType, aircraftType, airline);
101 SG_LOG(SG_AI, SG_BULK,
"Creating Pushback from " << parking->
ident() <<
" to " << parking->
getPushBackPoint()->getIndex());
103 int size = route.
size();
105 SG_LOG(SG_AI, SG_DEV_WARN,
"Push back route from gate " << parking->
ident() <<
" has only " << size <<
" nodes.\n" <<
"Using " << parking->
getPushBackPoint());
112 if (waypoints.size()>0) {
114 waypoints.back()->setSpeed(vTaxiBackward);
117 while (route.
next(node, &rte))
120 snprintf (buffer,
sizeof(buffer),
"pushback-%03d", (
short)node->getIndex());
134 pushBackWaypoint(wpt);
139 waypoints.back()->setName(
string(
"PushBackPoint"));
140 waypoints.back()->setSpeed(vTaxi);
148 if (!pushForwardSegment) {
150 SG_LOG(SG_AI, SG_DEV_WARN,
"Gate " << parking->
ident() <<
" at " << dep->
getId()
151 <<
" doesn't seem to have pushforward routes associated with it.");
154 pushBackWaypoint(wpt);
157 SGGeodesy::direct(parking->
geod(), parking->
getHeading(), 2.0, coord, az2);
158 wpt = createOnGround(ac,
string(
"taxiStart"), coord, dep->
getElevation(), vTaxiReduced);
159 pushBackWaypoint(wpt);
163 lastNodeVisited = pushForwardSegment->
getEnd();
164 double distance = pushForwardSegment->
getLength();
166 double parkingHeading = parking->
getHeading();
168 SG_LOG(SG_AI, SG_BULK,
"Creating Pushforward from ID " << pushForwardSegment->
getEnd()->getIndex() <<
" Length : \t" << distance);
170 if (waypoints.size() == 0) {
174 int numSegments = distance>15?(distance/5.0):3;
175 for (
int i = 1;
i < numSegments;
i++) {
176 SGGeod pushForwardPt;
178 SGGeodesy::direct(parking->
geod(), parkingHeading,
179 (((
double)
i / numSegments) * distance), pushForwardPt, az2);
181 snprintf(buffer,
sizeof(buffer),
"pushforward-%03d", (
short)
i);
185 pushBackWaypoint(wpt);
189 waypoints.back()->setName(
string(
"PushBackPoint-pushforward"));