- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
/******************************************************************************
|
|
|
|
* AIFlightPlanCreatePushBack.cxx
|
|
|
|
* Written by Durk Talsma, started August 1, 2007.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
**************************************************************************/
|
2008-12-27 16:09:01 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
#include <simgear/math/sg_geodesy.hxx>
|
2010-10-20 16:54:16 +00:00
|
|
|
|
|
|
|
#include <Airports/simple.hxx>
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
#include <Airports/runways.hxx>
|
2008-08-14 18:13:39 +00:00
|
|
|
#include <Airports/dynamics.hxx>
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
|
|
|
|
#include <Environment/environment_mgr.hxx>
|
|
|
|
#include <Environment/environment.hxx>
|
|
|
|
|
2009-05-05 10:36:38 +00:00
|
|
|
#include "AIFlightPlan.hxx"
|
|
|
|
#include "AIAircraft.hxx"
|
|
|
|
#include "performancedata.hxx"
|
|
|
|
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
|
2009-05-05 10:36:38 +00:00
|
|
|
// TODO: Use James Turner's createOnGround functions.
|
2009-02-15 15:29:56 +00:00
|
|
|
void FGAIFlightPlan::createPushBack(FGAIAircraft *ac,
|
|
|
|
bool firstFlight, FGAirport *dep,
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
double latitude,
|
|
|
|
double longitude,
|
|
|
|
double radius,
|
|
|
|
const string& fltType,
|
|
|
|
const string& aircraftType,
|
|
|
|
const string& airline)
|
|
|
|
{
|
|
|
|
double lat, lon, heading;
|
2009-05-05 10:36:38 +00:00
|
|
|
double vTaxi = ac->getPerformance()->vTaxi();
|
|
|
|
double vTaxiBackward = vTaxi * (-2.0/3.0);
|
|
|
|
double vTaxiReduced = vTaxi * (2.0/3.0);
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
FGTaxiRoute *pushBackRoute;
|
2009-02-15 15:29:56 +00:00
|
|
|
// Active runway can be conditionally set by ATC, so at the start of a new flight, this
|
|
|
|
// must be reset.
|
|
|
|
activeRunway.clear();
|
|
|
|
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
if (!(dep->getDynamics()->getGroundNetwork()->exists())) {
|
|
|
|
//cerr << "Push Back fallback" << endl;
|
2009-02-15 15:29:56 +00:00
|
|
|
createPushBackFallBack(ac, firstFlight, dep, latitude, longitude,
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
radius, fltType, aircraftType, airline);
|
|
|
|
} else {
|
|
|
|
if (firstFlight) {
|
2008-07-13 12:51:06 +00:00
|
|
|
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
if (!(dep->getDynamics()->getAvailableParking(&lat, &lon,
|
|
|
|
&heading, &gateId,
|
|
|
|
radius, fltType,
|
|
|
|
aircraftType, airline))) {
|
|
|
|
SG_LOG(SG_INPUT, SG_WARN, "Warning: Could not find parking for a " <<
|
|
|
|
aircraftType <<
|
|
|
|
" of flight type " << fltType <<
|
|
|
|
" of airline " << airline <<
|
|
|
|
" at airport " << dep->getId());
|
|
|
|
char buffer[10];
|
|
|
|
snprintf (buffer, 10, "%d", gateId);
|
|
|
|
//FGTaxiNode *tn = dep->getDynamics()->getGroundNetwork()->findNode(node);
|
|
|
|
waypoint *wpt;
|
|
|
|
wpt = new waypoint;
|
|
|
|
wpt->name = string(buffer); // fixme: should be the name of the taxiway
|
|
|
|
wpt->latitude = lat;
|
|
|
|
wpt->longitude = lon;
|
|
|
|
// Elevation is currently disregarded when on_ground is true
|
|
|
|
// because the AIModel obtains a periodic ground elevation estimate.
|
|
|
|
wpt->altitude = dep->getElevation();
|
2009-05-05 10:36:38 +00:00
|
|
|
wpt->speed = vTaxiBackward;
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
wpt->crossat = -10000;
|
|
|
|
wpt->gear_down = true;
|
|
|
|
wpt->flaps_down= true;
|
|
|
|
wpt->finished = false;
|
|
|
|
wpt->on_ground = true;
|
|
|
|
wpt->routeIndex = -1;
|
|
|
|
waypoints.push_back(wpt);
|
|
|
|
}
|
2008-07-13 12:51:06 +00:00
|
|
|
//cerr << "Success : GateId = " << gateId << endl;
|
|
|
|
SG_LOG(SG_INPUT, SG_WARN, "Warning: Succesfully found a parking for a " <<
|
|
|
|
aircraftType <<
|
|
|
|
" of flight type " << fltType <<
|
|
|
|
" of airline " << airline <<
|
|
|
|
" at airport " << dep->getId());
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
} else {
|
|
|
|
//cerr << "Push Back follow-up Flight" << endl;
|
|
|
|
dep->getDynamics()->getParking(gateId, &lat, &lon, &heading);
|
|
|
|
}
|
|
|
|
if (gateId < 0) {
|
2009-02-15 15:29:56 +00:00
|
|
|
createPushBackFallBack(ac, firstFlight, dep, latitude, longitude,
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
radius, fltType, aircraftType, airline);
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
//cerr << "getting parking " << gateId;
|
|
|
|
//cerr << " for a " <<
|
|
|
|
// aircraftType <<
|
|
|
|
// " of flight type " << fltType <<
|
|
|
|
// " of airline " << airline <<
|
|
|
|
// " at airport " << dep->getId() << endl;
|
|
|
|
FGParking *parking = dep->getDynamics()->getParking(gateId);
|
|
|
|
int pushBackNode = parking->getPushBackPoint();
|
|
|
|
|
|
|
|
|
2008-07-13 12:51:06 +00:00
|
|
|
pushBackRoute = parking->getPushBackRoute();
|
|
|
|
if ((pushBackNode > 0) && (pushBackRoute == 0)) {
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
int node, rte;
|
2008-07-13 12:51:06 +00:00
|
|
|
FGTaxiRoute route;
|
|
|
|
//cerr << "Creating push-back for " << gateId << " (" << parking->getName() << ") using push-back point " << pushBackNode << endl;
|
|
|
|
route = dep->getDynamics()->getGroundNetwork()->findShortestRoute(gateId, pushBackNode, false);
|
|
|
|
parking->setPushBackRoute(new FGTaxiRoute(route));
|
|
|
|
|
|
|
|
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
pushBackRoute = parking->getPushBackRoute();
|
|
|
|
int size = pushBackRoute->size();
|
|
|
|
if (size < 2) {
|
|
|
|
SG_LOG(SG_GENERAL, SG_WARN, "Push back route from gate " << gateId << " has only " << size << " nodes.");
|
2008-07-13 12:51:06 +00:00
|
|
|
SG_LOG(SG_GENERAL, SG_WARN, "Using " << pushBackNode);
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
}
|
|
|
|
pushBackRoute->first();
|
|
|
|
waypoint *wpt;
|
|
|
|
while(pushBackRoute->next(&node, &rte))
|
|
|
|
{
|
|
|
|
//FGTaxiNode *tn = apt->getDynamics()->getGroundNetwork()->findSegment(node)->getEnd();
|
|
|
|
char buffer[10];
|
|
|
|
snprintf (buffer, 10, "%d", node);
|
|
|
|
FGTaxiNode *tn = dep->getDynamics()->getGroundNetwork()->findNode(node);
|
|
|
|
//ids.pop_back();
|
|
|
|
wpt = new waypoint;
|
|
|
|
wpt->name = string(buffer); // fixme: should be the name of the taxiway
|
|
|
|
wpt->latitude = tn->getLatitude();
|
|
|
|
wpt->longitude = tn->getLongitude();
|
|
|
|
// Elevation is currently disregarded when on_ground is true
|
|
|
|
// because the AIModel obtains a periodic ground elevation estimate.
|
|
|
|
wpt->altitude = dep->getElevation();
|
2009-05-05 10:36:38 +00:00
|
|
|
wpt->speed = vTaxiBackward;
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
wpt->crossat = -10000;
|
|
|
|
wpt->gear_down = true;
|
|
|
|
wpt->flaps_down= true;
|
|
|
|
wpt->finished = false;
|
|
|
|
wpt->on_ground = true;
|
|
|
|
wpt->routeIndex = rte;
|
|
|
|
waypoints.push_back(wpt);
|
|
|
|
}
|
|
|
|
// some special considerations for the last point:
|
|
|
|
wpt->name = string("PushBackPoint");
|
2009-05-05 10:36:38 +00:00
|
|
|
wpt->speed = vTaxi;
|
2008-11-16 13:41:24 +00:00
|
|
|
//for (wpt_vector_iterator i = waypoints.begin(); i != waypoints.end(); i++) {
|
|
|
|
// cerr << "Waypoint Name: " << (*i)->name << endl;
|
|
|
|
//}
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
} else {
|
|
|
|
//cerr << "Creating direct forward departure route fragment" << endl;
|
2009-08-21 14:29:11 +00:00
|
|
|
double lat2 = 0.0, lon2 = 0.0, az2 = 0.0;
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
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();
|
2009-05-05 10:36:38 +00:00
|
|
|
wpt->speed = vTaxiReduced;
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
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();
|
2009-05-05 10:36:38 +00:00
|
|
|
wpt->speed = vTaxiReduced;
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
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();
|
2009-05-05 10:36:38 +00:00
|
|
|
wpt->speed = vTaxiReduced;
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*******************************************************************
|
|
|
|
* createPushBackFallBack
|
|
|
|
* This is the backup function for airports that don't have a
|
|
|
|
* network yet.
|
|
|
|
******************************************************************/
|
2009-02-15 15:29:56 +00:00
|
|
|
void FGAIFlightPlan::createPushBackFallBack(FGAIAircraft *ac, bool firstFlight, FGAirport *dep,
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
double latitude,
|
|
|
|
double longitude,
|
|
|
|
double radius,
|
|
|
|
const string& fltType,
|
|
|
|
const string& aircraftType,
|
|
|
|
const string& airline)
|
|
|
|
{
|
|
|
|
double heading;
|
|
|
|
double lat;
|
|
|
|
double lon;
|
2009-08-24 15:13:31 +00:00
|
|
|
double lat2 = 0.0;
|
|
|
|
double lon2 = 0.0;
|
|
|
|
double az2 = 0.0;
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
|
2009-05-05 10:36:38 +00:00
|
|
|
double vTaxi = ac->getPerformance()->vTaxi();
|
|
|
|
double vTaxiBackward = vTaxi * (-2.0/3.0);
|
|
|
|
double vTaxiReduced = vTaxi * (2.0/3.0);
|
|
|
|
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
dep->getDynamics()->getParking(-1, &lat, &lon, &heading);
|
|
|
|
|
|
|
|
heading += 180.0;
|
|
|
|
if (heading > 360)
|
|
|
|
heading -= 360;
|
|
|
|
waypoint *wpt = new waypoint;
|
|
|
|
wpt->name = "park";
|
|
|
|
wpt->latitude = lat;
|
|
|
|
wpt->longitude = lon;
|
|
|
|
wpt->altitude = dep->getElevation();
|
2009-05-05 10:36:38 +00:00
|
|
|
wpt->speed = vTaxiBackward;
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
wpt->crossat = -10000;
|
|
|
|
wpt->gear_down = true;
|
|
|
|
wpt->flaps_down= true;
|
|
|
|
wpt->finished = false;
|
|
|
|
wpt->on_ground = true;
|
|
|
|
|
|
|
|
waypoints.push_back(wpt);
|
|
|
|
|
|
|
|
geo_direct_wgs_84 ( 0, lat, lon, heading,
|
|
|
|
10,
|
|
|
|
&lat2, &lon2, &az2 );
|
|
|
|
wpt = new waypoint;
|
|
|
|
wpt->name = "park2";
|
|
|
|
wpt->latitude = lat2;
|
|
|
|
wpt->longitude = lon2;
|
|
|
|
wpt->altitude = dep->getElevation();
|
2009-05-05 10:36:38 +00:00
|
|
|
wpt->speed = vTaxiBackward;
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
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,
|
|
|
|
2.2*radius,
|
|
|
|
&lat2, &lon2, &az2 );
|
|
|
|
wpt = new waypoint;
|
|
|
|
wpt->name = "taxiStart";
|
|
|
|
wpt->latitude = lat2;
|
|
|
|
wpt->longitude = lon2;
|
|
|
|
wpt->altitude = dep->getElevation();
|
2009-05-05 10:36:38 +00:00
|
|
|
wpt->speed = vTaxiReduced;
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
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);
|
|
|
|
}
|