Skip to content

Commit

Permalink
Added programmatic DO-365B configuration (with and without SUM)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cesar Munoz committed Dec 11, 2020
1 parent 86abbb5 commit 1ea969e
Show file tree
Hide file tree
Showing 22 changed files with 405 additions and 37 deletions.
8 changes: 4 additions & 4 deletions C++/examples/DaidalusAlerting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ int main(int argc, char* argv[]) {
conf = base_filename.substr(0,base_filename.find_last_of('.'));
if (!daa.loadFromFile(arga)) {
if (arga == "no_sum") {
// Configure DAIDALUS as in DO-365A, but without SUM
daa.set_DO_365A(true,false);
// Configure DAIDALUS as in DO-365B, without SUM
daa.set_DO_365B(true,false);
conf = "no_sum";
} else if (arga == "nom_a") {
// Configure DAIDALUS to Nominal A: Buffered DWC, Kinematic Bands, Turn Rate 1.5 [deg/s]
Expand Down Expand Up @@ -129,8 +129,8 @@ int main(int argc, char* argv[]) {
}
if (daa.numberOfAlerters()==0) {
// If no alerter has been configured, configure alerters as in
// DO_365A Phase I and Phase II
daa.set_DO_365A();
// DO_365B Phase I, Phase II, and Non-Cooperative, with SUM
daa.set_DO_365B();
}
if (params.size() > 0) {
daa.setParameterData(params);
Expand Down
8 changes: 4 additions & 4 deletions C++/examples/DaidalusBatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,12 @@ int main(int argc, const char* argv[]) {
Daidalus daa;

if (config == "") {
// Configure alerters as in DO_365A Phase I and Phase II
daa.set_DO_365A();
// Configure alerters as in DO_365B Phase I, Phase II, and Non-Cooperative, with SUM
daa.set_DO_365B();
} else if (!daa.loadFromFile(config)) {
if (config == "no_sum") {
// Configure DAIDALUS as in DO-365A, but without SUM
daa.set_DO_365A(true,false);
// Configure DAIDALUS as in DO-365B, without SUM
daa.set_DO_365B(true,false);
} else if (config == "nom_a") {
// Configure DAIDALUS to Nominal A: Buffered DWC, Kinematic Bands, Turn Rate 1.5 [deg/s]
daa.set_Buffered_WC_DO_365(false);
Expand Down
8 changes: 4 additions & 4 deletions C++/examples/DaidalusExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ int main(int argc, char* argv[]) {
if (daa.loadFromFile(arga)) {
std::cout << "Loading configuration file " << arga << std::endl;
} else if (arga == "no_sum") {
// Configure DAIDALUS to Nominal A: Buffered DWC, Kinematic Bands, Turn Rate 1.5 [deg/s]
daa.set_DO_365A(true,false);
// Configure DAIDALUS as in DO-365B, without SUM
daa.set_DO_365B(true,false);
} else if (arga == "nom_a") {
// Configure DAIDALUS to Nominal A: Buffered DWC, Kinematic Bands, Turn Rate 1.5 [deg/s]
daa.set_Buffered_WC_DO_365(false);
Expand Down Expand Up @@ -339,8 +339,8 @@ int main(int argc, char* argv[]) {

if (daa.numberOfAlerters()==0) {
// If no alerter has been configured, configure alerters as in
// DO_365A Phase I and Phase II
daa.set_DO_365A();
// DO_365B Phase I, Phase II, and Non-Cooperative, with SUM
daa.set_DO_365B();
}

double t = 0.0;
Expand Down
58 changes: 58 additions & 0 deletions C++/include/Alerter.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,35 @@ class Alerter : ParameterAcceptor {
*/
static const Alerter& DWC_Phase_II();

/**
* @return DO-365B HAZ preventive thresholds Non-Cooperative, i.e., DTHR=2200ft, ZTHR=450ft,
* TTHR=0s, TCOA=0, alerting time = 55s, early alerting time = 110s,
* bands region = NONE
*/
static const AlertThresholds& DO_365_Non_Coop_HAZ_preventive();

/**
* @return DO-365B HAZ corrective thresholds Non-Cooperative, i.e., DTHR=2200ft, ZTHR=450ft,
* TTHR=0s, TCOA=0, alerting time = 55s, early alerting time = 110s,
* bands region = MID
*/
static const AlertThresholds& DO_365_Non_Coop_HAZ_corrective();

/**
* @return DO-365B HAZ warning thresholds Non-Cooperative, i.e., DTHR=2200ft, ZTHR=450ft,
* TTHR=0s, TCOA=0, alerting time = 25s, early alerting time = 90s,
* bands region = NEAR
*/
static const AlertThresholds& DO_365_Non_Coop_HAZ_warning();

/**
* @return alerting thresholds as defined in RTCA DO-365B Non-Cooperative
* Maneuver guidance logic produces multilevel bands:
* MID: Corrective
* NEAR: Warning
*/
static const Alerter& DWC_Non_Coop();

/**
* @return DO-365 HAZ preventive thresholds Phase I (en-route), i.e., DTHR=0.66nmi, ZTHR=700ft,
* TTHR=35s, TCOA=0, alerting time = 50s, early alerting time = 75s,
Expand Down Expand Up @@ -166,6 +195,35 @@ class Alerter : ParameterAcceptor {
*/
static const Alerter& DWC_Phase_II_SUM();

/**
* @return DO-365B HAZ preventive thresholds Non-Cooperative, i.e., DTHR=2200ft, ZTHR=450ft,
* TTHR=0s, TCOA=0, alerting time = 50s, early alerting time = 110s,
* bands region = NONE, with SUM
*/
static const AlertThresholds& DO_365_Non_Coop_HAZ_preventive_SUM();

/**
* @return DO-365B HAZ corrective thresholds Non-Cooperative, i.e., DTHR=2200ft, ZTHR=450ft,
* TTHR=0s, TCOA=0, alerting time = 50s, early alerting time = 110s,
* bands region = MID, with SUM
*/
static const AlertThresholds& DO_365_Non_Coop_HAZ_corrective_SUM();

/**
* @return DO-365B HAZ warning thresholds Non-Cooperative, i.e., DTHR=2200ft, ZTHR=450ft,
* TTHR=0s, TCOA=0, alerting time = 20s, early alerting time = 90s,
* bands region = NEAR, with SUM
*/
static const AlertThresholds& DO_365_Non_Coop_HAZ_warning_SUM();

/**
* @return alerting thresholds as defined in RTCA DO-365B Non-Cooperative, with SUM
* Maneuver guidance logic produces multilevel bands:
* MID: Corrective
* NEAR: Warning
*/
static const Alerter& DWC_Non_Coop_SUM();

/**
* @return buffered HAZ preventive thresholds, i.e., DTHR=1nmi, ZTHR=750ft,
* TTHR=35s, TCOA=20s, alerting time = 60s, early alerting time = 75s,
Expand Down
13 changes: 12 additions & 1 deletion C++/include/Daidalus.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class Daidalus : public GenericStateBands, public ErrorReporter {
/**
* Construct an empty Daidalus object.
* NOTE: This object doesn't have any alert configured. Alerters can be
* configured either programmatically, set_DO_365A(true,true) or
* configured either programmatically, set_DO_365B() or
* via a configuration file with the method loadFromFile(configurationfile)
**/
Daidalus();
Expand Down Expand Up @@ -141,6 +141,17 @@ class Daidalus : public GenericStateBands, public ErrorReporter {
*/
void set_DO_365A(bool type=true, bool sum=true);

/*
* Set Daidalus object such that
* - Configure two alerters (Phase I, Phase II, and Non-Cooperative) as defined as in RTCA DO-365B
* - Maneuver guidance logic assumes kinematic maneuvers
* - Turn rate is set to 3 deg/s, when type is true, and to 1.5 deg/s
* when type is false.
* - Configure Sensor Uncertainty Migitation (SUM) when sum is true
* - Bands don't saturate until NMAC
*/
void set_DO_365B(bool type=true, bool sum=true);

/*
* Set DAIDALUS object such that
* - Alerting thresholds are buffered
Expand Down
10 changes: 8 additions & 2 deletions C++/include/WCVTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,17 @@ class WCVTable : public ParameterTable {
static const WCVTable& DO_365_DWC_Phase_I();

/**
* @return DO-365 Well-Clear thresholds Phase II (DTA), i.e., DTHR=0.66nmi, ZTHR=450ft,
* TTHR=35s, TCOA=0.
* @return DO-365 Well-Clear thresholds Phase II (DTA), i.e., DTHR=1500ft, ZTHR=450ft,
* TTHR=0, TCOA=0.
*/
static const WCVTable& DO_365_DWC_Phase_II();

/**
* @return DO-365 Well-Clear thresholds Non-Cooperative, i.e., DTHR=2200ft, ZTHR=450ft,
* TTHR=0, TCOA=0.
*/
static const WCVTable& DO_365_DWC_Non_Coop();

/**
* @return buffered preventive thresholds Phase I (en-route), i.e., DTHR=1.0nmi, ZTHR=750ft,
* TTHR=35s, TCOA=20.
Expand Down
6 changes: 6 additions & 0 deletions C++/include/WCV_TAUMOD.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ class WCV_TAUMOD : public WCV_tvar {
*/
static const WCV_TAUMOD& DO_365_DWC_Phase_II();

/**
* @return DO-365 Well-Clear thresholds Non-Cooperative, i.e., DTHR=2200 [ft], ZTHR=450ft,
* TTHR=0s, TCOA=0.
*/
static const WCV_TAUMOD& DO_365_DWC_Non_Coop();

/**
* @return buffered preventive thresholds Phase I (en-route), i.e., DTHR=1nmi, ZTHR=750ft,
* TTHR=35s, TCOA=20.
Expand Down
6 changes: 6 additions & 0 deletions C++/include/WCV_TAUMOD_SUM.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ class WCV_TAUMOD_SUM : public WCV_TAUMOD {
*/
static const WCV_TAUMOD_SUM& DO_365_DWC_Phase_II();

/**
* @return DO-365 Well-Clear thresholds Non-Cooperative, i.e., DTHR=2200 [ft], ZTHR=450ft,
* TTHR=0s, TCOA=0.
*/
static const WCV_TAUMOD_SUM& DO_365_DWC_Non_Coop();

virtual ConflictData conflictDetectionWithTrafficState(const TrafficState& ownship, const TrafficState& intruder,
double B, double T) const;

Expand Down
92 changes: 92 additions & 0 deletions C++/src/Alerter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,98 @@ const Alerter& Alerter::DWC_Phase_II() {
return alerter;
}

/**
* @return DO-365B HAZ preventive thresholds Non-Cooperative, i.e., DTHR=2200ft, ZTHR=450ft,
* TTHR=0s, TCOA=0, alerting time = 55s, early alerting time = 110s,
* bands region = NONE
*/
const AlertThresholds& Alerter::DO_365_Non_Coop_HAZ_preventive() {
static AlertThresholds preventive(&WCV_TAUMOD::DO_365_DWC_Non_Coop(),55,110,BandsRegion::NONE);
return preventive;
}

/**
* @return DO-365B HAZ corrective thresholds Non-Cooperative, i.e., DTHR=2200ft, ZTHR=450ft,
* TTHR=0s, TCOA=0, alerting time = 55s, early alerting time = 110s,
* bands region = MID
*/
const AlertThresholds& Alerter::DO_365_Non_Coop_HAZ_corrective() {
static AlertThresholds preventive(&WCV_TAUMOD::DO_365_DWC_Non_Coop(),55,110,BandsRegion::MID);
return preventive;
}

/**
* @return DO-365B HAZ warning thresholds Non-Cooperative, i.e., DTHR=2200ft, ZTHR=450ft,
* TTHR=0s, TCOA=0, alerting time = 25s, early alerting time = 90s,
* bands region = NEAR
*/
const AlertThresholds& Alerter::DO_365_Non_Coop_HAZ_warning() {
static AlertThresholds warning(&WCV_TAUMOD::DO_365_DWC_Non_Coop(),25,90,BandsRegion::NEAR);
return warning;
}

/**
* @return alerting thresholds as defined in RTCA DO-365B Non-Cooperative
* Maneuver guidance logic produces multilevel bands:
* MID: Corrective
* NEAR: Warning
*/
const Alerter& Alerter::DWC_Non_Coop() {
static Alerter alerter("DWC_Non_Coop");
if (!alerter.isValid()) {
alerter.addLevel(DO_365_Non_Coop_HAZ_preventive());
alerter.addLevel(DO_365_Non_Coop_HAZ_corrective());
alerter.addLevel(DO_365_Non_Coop_HAZ_warning());
}
return alerter;
}

/**
* @return DO-365B HAZ preventive thresholds Non-Cooperative, i.e., DTHR=2200ft, ZTHR=450ft,
* TTHR=0s, TCOA=0, alerting time = 50s, early alerting time = 110s,
* bands region = NONE, with SUM
*/
const AlertThresholds& Alerter::DO_365_Non_Coop_HAZ_preventive_SUM() {
static AlertThresholds preventive(&WCV_TAUMOD_SUM::DO_365_DWC_Non_Coop(),50,110,BandsRegion::NONE);
return preventive;
}

/**
* @return DO-365B HAZ corrective thresholds Non-Cooperative, i.e., DTHR=2200ft, ZTHR=450ft,
* TTHR=0s, TCOA=0, alerting time = 50s, early alerting time = 110s,
* bands region = MID, with SUM
*/
const AlertThresholds& Alerter::DO_365_Non_Coop_HAZ_corrective_SUM() {
static AlertThresholds preventive(&WCV_TAUMOD_SUM::DO_365_DWC_Non_Coop(),50,110,BandsRegion::MID);
return preventive;
}

/**
* @return DO-365B HAZ warning thresholds Non-Cooperative, i.e., DTHR=2200ft, ZTHR=450ft,
* TTHR=0s, TCOA=0, alerting time = 20s, early alerting time = 90s,
* bands region = NEAR, with SUM
*/
const AlertThresholds& Alerter::DO_365_Non_Coop_HAZ_warning_SUM() {
static AlertThresholds warning(&WCV_TAUMOD_SUM::DO_365_DWC_Non_Coop(),20,90,BandsRegion::NEAR);
return warning;
}

/**
* @return alerting thresholds as defined in RTCA DO-365B Non-Cooperative, with SUM
* Maneuver guidance logic produces multilevel bands:
* MID: Corrective
* NEAR: Warning
*/
const Alerter& Alerter::DWC_Non_Coop_SUM() {
static Alerter alerter("DWC_Non_Coop_SUM");
if (!alerter.isValid()) {
alerter.addLevel(DO_365_Non_Coop_HAZ_preventive_SUM());
alerter.addLevel(DO_365_Non_Coop_HAZ_corrective_SUM());
alerter.addLevel(DO_365_Non_Coop_HAZ_warning_SUM());
}
return alerter;
}

/**
* @return DO-365 HAZ preventive thresholds Phase I (en-route), i.e., DTHR=0.66nmi, ZTHR=700ft,
* TTHR=35s, TCOA=0, alerting time = 50s, early alerting time = 75s,
Expand Down
20 changes: 19 additions & 1 deletion C++/src/Daidalus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ namespace larcfm {
/**
* Construct an empty Daidalus object.
* NOTE: This object doesn't have any alert configured. Alerters can be
* configured either programmatically, set_DO_365A(true,true) or
* configured either programmatically, set_DO_365B() or
* via a configuration file with the method loadFromFile(configurationfile)
**/
Daidalus::Daidalus() : error("Daidalus") {}
Expand Down Expand Up @@ -153,6 +153,24 @@ void Daidalus::set_DO_365A(bool type, bool sum) {
setDTAAlerter(2);
}

/*
* Set Daidalus object such that
* - Configure two alerters (Phase I, Phase II, and Non-Cooperative) as defined as in RTCA DO-365B
* - Maneuver guidance logic assumes kinematic maneuvers
* - Turn rate is set to 3 deg/s, when type is true, and to 1.5 deg/s
* when type is false.
* - Configure Sensor Uncertainty Migitation (SUM) when sum is true
* - Bands don't saturate until NMAC
*/
void Daidalus::set_DO_365B(bool type, bool sum) {
set_DO_365A(type,sum);
if (sum) {
addAlerter(Alerter::DWC_Non_Coop_SUM());
} else {
addAlerter(Alerter::DWC_Non_Coop());
}
}

/*
* Set DAIDALUS object such that
* - Alerting thresholds are buffered
Expand Down
13 changes: 11 additions & 2 deletions C++/src/WCVTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,23 @@ const WCVTable& WCVTable::DO_365_DWC_Phase_I() {
}

/**
* @return DO-365 Well-Clear thresholds Phase II (DTA), i.e., DTHR=0.66nmi, ZTHR=450ft,
* TTHR=35s, TCOA=0.
* @return DO-365 Well-Clear thresholds Phase II (DTA), i.e., DTHR=1500ft, ZTHR=450ft,
* TTHR=0, TCOA=0.
*/
const WCVTable& WCVTable::DO_365_DWC_Phase_II() {
static WCVTable dwc(1500,"ft",450,"ft",0,"s",0,"s");
return dwc;
}

/**
* @return DO-365 Well-Clear thresholds Non-Cooperative, i.e., DTHR=2200ft, ZTHR=450ft,
* TTHR=0, TCOA=0.
*/
const WCVTable& WCVTable::DO_365_DWC_Non_Coop() {
static WCVTable dwc(2200,"ft",450,"ft",0,"s",0,"s");
return dwc;
}

/**
* @return buffered preventive thresholds Phase I (en-route), i.e., DTHR=1.0nmi, ZTHR=750ft,
* TTHR=35s, TCOA=20.
Expand Down
9 changes: 9 additions & 0 deletions C++/src/WCV_TAUMOD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ const WCV_TAUMOD& WCV_TAUMOD::DO_365_DWC_Phase_II() {
return dwc;
}

/**
* @return DO-365 Well-Clear thresholds Non-Cooperative, i.e., DTHR=2200 [ft], ZTHR=450ft,
* TTHR=0s, TCOA=0.
*/
const WCV_TAUMOD& WCV_TAUMOD::DO_365_DWC_Non_Coop() {
static WCV_TAUMOD dwc(WCVTable::DO_365_DWC_Non_Coop());
return dwc;
}

/**
* @return buffered preventive thresholds Phase I (en-route), i.e., DTHR=1nmi, ZTHR=750ft,
* TTHR=35s, TCOA=20.
Expand Down
9 changes: 9 additions & 0 deletions C++/src/WCV_TAUMOD_SUM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ const WCV_TAUMOD_SUM& WCV_TAUMOD_SUM::DO_365_DWC_Phase_II() {
return dwc;
}

/**
* @return DO-365 Well-Clear thresholds Non-Cooperative, i.e., DTHR=2200 [ft], ZTHR=450ft,
* TTHR=0s, TCOA=0.
*/
const WCV_TAUMOD_SUM& WCV_TAUMOD_SUM::DO_365_DWC_Non_Coop() {
static WCV_TAUMOD_SUM dwc(WCVTable::DO_365_DWC_Non_Coop());
return dwc;
}

void WCV_TAUMOD_SUM::copyFrom(const WCV_TAUMOD_SUM& wcv) {
if (&wcv != this) {
id = wcv.id;
Expand Down
Loading

0 comments on commit 1ea969e

Please sign in to comment.