Finetuning of AI Aircraft landing performance. Aircraft slow down to taxi speeds just before leaving the runway. Increased vTaxi on the runway to further reduce time on the runway and slow down to vTouchdown well ahead of touching down.
This commit is contained in:
parent
88dc9a14b7
commit
835334bd4f
3 changed files with 29 additions and 16 deletions
|
@ -887,17 +887,17 @@ bool FGAIAircraft::handleAirportEndPoints(FGAIWaypoint* prev, time_t now) {
|
||||||
// fp->shortenToFirst(2, "legend");
|
// fp->shortenToFirst(2, "legend");
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
/*if (prev->contains(string("final"))) {
|
//if (prev->contains(string("final"))) {
|
||||||
|
//
|
||||||
cerr << getCallSign() << " "
|
// cerr << getCallSign() << " "
|
||||||
<< fp->getPreviousWaypoint()->getName()
|
// << fp->getPreviousWaypoint()->getName()
|
||||||
<< ". Alt = " << altitude_ft
|
// << ". Alt = " << altitude_ft
|
||||||
<< " vs " << vs
|
// << " vs " << vs
|
||||||
<< " horizontal speed " << speed
|
// << " horizontal speed " << speed
|
||||||
<< "Previous crossAT " << fp->getPreviousWaypoint()->getCrossat()
|
// << "Previous crossAT " << fp->getPreviousWaypoint()->getCrossat()
|
||||||
<< "Airport elevation" << getTrafficRef()->getArrivalAirport()->getElevation()
|
// << "Airport elevation" << getTrafficRef()->getArrivalAirport()->getElevation()
|
||||||
<< "Altitude difference " << (altitude_ft - fp->getPreviousWaypoint()->getCrossat()) << endl;
|
// << "Altitude difference " << (altitude_ft - fp->getPreviousWaypoint()->getCrossat()) << endl;
|
||||||
}*/
|
//q}
|
||||||
// This is the last taxi waypoint, and marks the the end of the flight plan
|
// This is the last taxi waypoint, and marks the the end of the flight plan
|
||||||
// so, the schedule should update and wait for the next departure time.
|
// so, the schedule should update and wait for the next departure time.
|
||||||
if (prev->contains("END")) {
|
if (prev->contains("END")) {
|
||||||
|
|
|
@ -575,6 +575,7 @@ bool FGAIFlightPlan::createDescent(FGAIAircraft * ac, FGAirport * apt,
|
||||||
FGAIWaypoint *wpt;
|
FGAIWaypoint *wpt;
|
||||||
double vDescent = ac->getPerformance()->vDescent();
|
double vDescent = ac->getPerformance()->vDescent();
|
||||||
double vApproach = ac->getPerformance()->vApproach();
|
double vApproach = ac->getPerformance()->vApproach();
|
||||||
|
double vTouchdown = ac->getPerformance()->vTouchdown();
|
||||||
|
|
||||||
|
|
||||||
//Beginning of Descent
|
//Beginning of Descent
|
||||||
|
@ -821,6 +822,7 @@ bool FGAIFlightPlan::createDescent(FGAIAircraft * ac, FGAirport * apt,
|
||||||
|
|
||||||
// The approach leg should bring the aircraft to approximately 4-6 nm out, after which the landing phase should take over.
|
// The approach leg should bring the aircraft to approximately 4-6 nm out, after which the landing phase should take over.
|
||||||
//cerr << "Phase 3: Approach" << endl;
|
//cerr << "Phase 3: Approach" << endl;
|
||||||
|
double tgt_speed = vApproach;
|
||||||
distanceOut -= distanceCovered;
|
distanceOut -= distanceCovered;
|
||||||
double touchDownPoint = 0; //(rwy->lengthM() * 0.1);
|
double touchDownPoint = 0; //(rwy->lengthM() * 0.1);
|
||||||
for (int i = 1; i < nPoints; i++) {
|
for (int i = 1; i < nPoints; i++) {
|
||||||
|
@ -831,7 +833,10 @@ bool FGAIFlightPlan::createDescent(FGAIAircraft * ac, FGAirport * apt,
|
||||||
double alt = currentAltitude - (i * 2000 / (nPoints - 1));
|
double alt = currentAltitude - (i * 2000 / (nPoints - 1));
|
||||||
snprintf(buffer, 16, "final%03d", i);
|
snprintf(buffer, 16, "final%03d", i);
|
||||||
result = rwy->pointOnCenterline((-distanceOut) + currentDist + touchDownPoint);
|
result = rwy->pointOnCenterline((-distanceOut) + currentDist + touchDownPoint);
|
||||||
wpt = createInAir(ac, buffer, result, alt, vApproach);
|
if (i == nPoints - 30) {
|
||||||
|
tgt_speed = vTouchdown;
|
||||||
|
}
|
||||||
|
wpt = createInAir(ac, buffer, result, alt, tgt_speed);
|
||||||
wpt->setCrossat(alt);
|
wpt->setCrossat(alt);
|
||||||
wpt->setTrackLength((distanceOut / nPoints));
|
wpt->setTrackLength((distanceOut / nPoints));
|
||||||
// account for the extra distance due to an extended downwind leg
|
// account for the extra distance due to an extended downwind leg
|
||||||
|
@ -891,7 +896,7 @@ bool FGAIFlightPlan::createLanding(FGAIAircraft * ac, FGAirport * apt,
|
||||||
{
|
{
|
||||||
double vTouchdown = ac->getPerformance()->vTouchdown();
|
double vTouchdown = ac->getPerformance()->vTouchdown();
|
||||||
double vTaxi = ac->getPerformance()->vTaxi();
|
double vTaxi = ac->getPerformance()->vTaxi();
|
||||||
double decel = ac->getPerformance()->deceleration() * 1.5;
|
double decel = ac->getPerformance()->deceleration() * 1.4;
|
||||||
|
|
||||||
double vTouchdownMetric = (vTouchdown * SG_NM_TO_METER) / 3600;
|
double vTouchdownMetric = (vTouchdown * SG_NM_TO_METER) / 3600;
|
||||||
double vTaxiMetric = (vTaxi * SG_NM_TO_METER) / 3600;
|
double vTaxiMetric = (vTaxi * SG_NM_TO_METER) / 3600;
|
||||||
|
@ -936,16 +941,17 @@ bool FGAIFlightPlan::createLanding(FGAIAircraft * ac, FGAirport * apt,
|
||||||
}*/
|
}*/
|
||||||
double rolloutDistance =
|
double rolloutDistance =
|
||||||
(vTouchdownMetric * vTouchdownMetric - vTaxiMetric * vTaxiMetric) / (2 * decelMetric);
|
(vTouchdownMetric * vTouchdownMetric - vTaxiMetric * vTaxiMetric) / (2 * decelMetric);
|
||||||
//cerr << " touchdown speed = " << vTouchdown << ". Rollout distance " << rolloutDistance << endl;
|
cerr << " touchdown speed = " << vTouchdown << ". Rollout distance " << rolloutDistance << endl;
|
||||||
int nPoints = 50;
|
int nPoints = 50;
|
||||||
for (int i = 1; i < nPoints; i++) {
|
for (int i = 1; i < nPoints; i++) {
|
||||||
snprintf(buffer, 12, "landing03%d", i);
|
snprintf(buffer, 12, "landing03%d", i);
|
||||||
|
|
||||||
coord = rwy->pointOnCenterline((rolloutDistance * ((double) i / (double) nPoints)));
|
coord = rwy->pointOnCenterline((rolloutDistance * ((double) i / (double) nPoints)));
|
||||||
wpt = createOnGround(ac, buffer, coord, currElev, vTaxi);
|
wpt = createOnGround(ac, buffer, coord, currElev, 2*vTaxi);
|
||||||
wpt->setCrossat(currElev);
|
wpt->setCrossat(currElev);
|
||||||
waypoints.push_back(wpt);
|
waypoints.push_back(wpt);
|
||||||
}
|
}
|
||||||
|
wpt->setSpeed(vTaxi);
|
||||||
double mindist = 1.1 * rolloutDistance;
|
double mindist = 1.1 * rolloutDistance;
|
||||||
double maxdist = rwy->lengthM();
|
double maxdist = rwy->lengthM();
|
||||||
//cerr << "Finding nearest exit" << endl;
|
//cerr << "Finding nearest exit" << endl;
|
||||||
|
|
|
@ -6,6 +6,13 @@
|
||||||
#include "performancedata.hxx"
|
#include "performancedata.hxx"
|
||||||
#include "AIAircraft.hxx"
|
#include "AIAircraft.hxx"
|
||||||
|
|
||||||
|
|
||||||
|
// For now, make this a define
|
||||||
|
// Later on, additional class variables can simulate settings such as braking power
|
||||||
|
// also, the performance parameters can be tweaked a little to add some personality
|
||||||
|
// to the AIAircraft.
|
||||||
|
#define BRAKE_SETTING 1.6
|
||||||
|
|
||||||
PerformanceData::PerformanceData(double acceleration,
|
PerformanceData::PerformanceData(double acceleration,
|
||||||
double deceleration,
|
double deceleration,
|
||||||
double climbRate,
|
double climbRate,
|
||||||
|
@ -59,7 +66,7 @@ double PerformanceData::actualSpeed(FGAIAircraft* ac, double tgt_speed, double d
|
||||||
} else if (speed_diff < 0.0) { // decelerate
|
} else if (speed_diff < 0.0) { // decelerate
|
||||||
if (ac->onGround()) {
|
if (ac->onGround()) {
|
||||||
// deceleration performance is better due to wheel brakes.
|
// deceleration performance is better due to wheel brakes.
|
||||||
speed -= 3 * _deceleration * dt;
|
speed -= BRAKE_SETTING * _deceleration * dt;
|
||||||
} else {
|
} else {
|
||||||
speed -= _deceleration * dt;
|
speed -= _deceleration * dt;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue