From 4ea9c3341930008a3ebfbc52520ee80288c6fabe Mon Sep 17 00:00:00 2001 From: 30hours Date: Fri, 14 Jun 2024 06:55:54 +0000 Subject: [PATCH] Add enable flag for clutter, detection and tracker --- config/config-hackrf.yml | 3 ++ config/config-kraken.yml | 3 ++ config/config-usrp.yml | 3 ++ config/config.yml | 3 ++ config/radar4.yml | 3 ++ src/blah2.cpp | 59 ++++++++++++++++++++++++++++------------ 6 files changed, 57 insertions(+), 17 deletions(-) diff --git a/config/config-hackrf.yml b/config/config-hackrf.yml index 21a8c9a..d02bf64 100644 --- a/config/config-hackrf.yml +++ b/config/config-hackrf.yml @@ -25,9 +25,11 @@ process: dopplerMin: -200 dopplerMax: 200 clutter: + enable: true delayMin: -10 delayMax: 400 detection: + enable: true pfa: 0.00001 nGuard: 2 nTrain: 6 @@ -35,6 +37,7 @@ process: minDoppler: 15 nCentroid: 6 tracker: + enable: true initiate: M: 3 N: 5 diff --git a/config/config-kraken.yml b/config/config-kraken.yml index aed4480..5846c39 100644 --- a/config/config-kraken.yml +++ b/config/config-kraken.yml @@ -25,9 +25,11 @@ process: dopplerMin: -200 dopplerMax: 200 clutter: + enable: true delayMin: -10 delayMax: 400 detection: + enable: true pfa: 0.00001 nGuard: 2 nTrain: 6 @@ -35,6 +37,7 @@ process: minDoppler: 15 nCentroid: 6 tracker: + enable: true initiate: M: 3 N: 5 diff --git a/config/config-usrp.yml b/config/config-usrp.yml index c4a212d..977082f 100644 --- a/config/config-usrp.yml +++ b/config/config-usrp.yml @@ -23,9 +23,11 @@ process: dopplerMin: -200 dopplerMax: 200 clutter: + enable: true delayMin: -10 delayMax: 400 detection: + enable: true pfa: 0.00001 nGuard: 2 nTrain: 6 @@ -33,6 +35,7 @@ process: minDoppler: 15 nCentroid: 6 tracker: + enable: true initiate: M: 3 N: 5 diff --git a/config/config.yml b/config/config.yml index 4638741..5613a29 100644 --- a/config/config.yml +++ b/config/config.yml @@ -19,9 +19,11 @@ process: dopplerMin: -200 dopplerMax: 200 clutter: + enable: true delayMin: -10 delayMax: 400 detection: + enable: true pfa: 0.00001 nGuard: 2 nTrain: 6 @@ -29,6 +31,7 @@ process: minDoppler: 15 nCentroid: 6 tracker: + enable: true initiate: M: 3 N: 5 diff --git a/config/radar4.yml b/config/radar4.yml index 45ff854..16af23d 100644 --- a/config/radar4.yml +++ b/config/radar4.yml @@ -19,9 +19,11 @@ process: dopplerMin: -200 dopplerMax: 200 clutter: + enable: true delayMin: -10 delayMax: 400 detection: + enable: true pfa: 0.00001 nGuard: 2 nTrain: 6 @@ -29,6 +31,7 @@ process: minDoppler: 15 nCentroid: 6 tracker: + enable: true initiate: M: 3 N: 5 diff --git a/src/blah2.cpp b/src/blah2.cpp index 9d3231b..e984f76 100644 --- a/src/blah2.cpp +++ b/src/blah2.cpp @@ -184,6 +184,16 @@ int main(int argc, char **argv) double spectrumBandwidth = 2000; SpectrumAnalyser *spectrumAnalyser = new SpectrumAnalyser(nSamples, spectrumBandwidth); + // process options + bool isClutter, isDetection, isTracker; + tree["process"]["clutter"]["enable"] >> isClutter; + tree["process"]["detection"]["enable"] >> isDetection; + tree["process"]["tracker"]["enable"] >> isTracker; + if (!isDetection) + { + isTracker = false; + } + // setup output data bool saveMap; tree["save"]["map"] >> saveMap; @@ -237,11 +247,14 @@ int main(int argc, char **argv) timing_helper(timing_name, timing_time, time, "spectrum"); // clutter filter - if (!filter->process(x, y)) + if (isClutter) { - continue; + if (!filter->process(x, y)) + { + continue; + } + timing_helper(timing_name, timing_time, time, "clutter_filter"); } - timing_helper(timing_name, timing_time, time, "clutter_filter"); // ambiguity process map = ambiguity->process(x, y); @@ -249,14 +262,20 @@ int main(int argc, char **argv) timing_helper(timing_name, timing_time, time, "ambiguity_processing"); // detection process - detection1 = cfarDetector1D->process(map); - detection2 = centroid->process(detection1); - detection = interpolate->process(detection2, map); - timing_helper(timing_name, timing_time, time, "detector"); + if (isDetection) + { + detection1 = cfarDetector1D->process(map); + detection2 = centroid->process(detection1); + detection = interpolate->process(detection2, map); + timing_helper(timing_name, timing_time, time, "detector"); + } // tracker process - track = tracker->process(detection, time[0]/1000); - timing_helper(timing_name, timing_time, time, "tracker"); + if (isTracker) + { + track = tracker->process(detection, time[0]/1000); + timing_helper(timing_name, timing_time, time, "tracker"); + } // output IqData meta data jsonIqData = x->to_json(time[0]/1000); @@ -272,16 +291,22 @@ int main(int argc, char **argv) socket_map.sendData(mapJson); // output detection data - detectionJson = detection->to_json(time[0]/1000); - detectionJson = detection->delay_bin_to_km(detectionJson, fs); - socket_detection.sendData(detectionJson); - delete detection; - delete detection1; - delete detection2; + if (isDetection) + { + detectionJson = detection->to_json(time[0]/1000); + detectionJson = detection->delay_bin_to_km(detectionJson, fs); + socket_detection.sendData(detectionJson); + delete detection; + delete detection1; + delete detection2; + } // output tracker data - jsonTracker = track->to_json(time[0]/1000); - socket_track.sendData(jsonTracker); + if (isTracker) + { + jsonTracker = track->to_json(time[0]/1000); + socket_track.sendData(jsonTracker); + } // output radar data timer timing_helper(timing_name, timing_time, time, "output_radar_data");