From 6eddada856ffca7b9c1f036f3c2ced8cb3f90c6f Mon Sep 17 00:00:00 2001 From: 30hours Date: Sat, 25 Nov 2023 22:46:10 +0000 Subject: [PATCH] Min delay/doppler detections and js cleanup --- html/index.html | 13 ++++++++++++- html/{plot.js => js/plot_map.js} | 22 +++++++--------------- html/maxhold/index.html | 12 +++++++++++- src/process/detection/CfarDetector1D.cpp | 10 ++++++++++ 4 files changed, 40 insertions(+), 17 deletions(-) rename html/{plot.js => js/plot_map.js} (95%) diff --git a/html/index.html b/html/index.html index 7e9b58b..4d43d94 100644 --- a/html/index.html +++ b/html/index.html @@ -94,7 +94,18 @@ - + + + diff --git a/html/plot.js b/html/js/plot_map.js similarity index 95% rename from html/plot.js rename to html/js/plot_map.js index e95de3a..dbb7792 100644 --- a/html/plot.js +++ b/html/js/plot_map.js @@ -2,24 +2,9 @@ var timestamp = -1; var nRows = 3; var nCols = 3; var host = window.location.hostname; -var timestamp = ''; var isLocalHost = (host === "localhost" || host === "127.0.0.1" || host === "192.168.0.112"); -var urlMap = '' -if (isLocalHost) { - urlMap = '//' + host + ':3000/map?timestamp=' + Date.now(); -} else { - urlMap = '//' + host + '/api/map?timestamp=' + Date.now(); -} - -var urlTimestamp = ''; -if (isLocalHost) { - urlTimestamp = '//' + host + ':3000/timestamp?timestamp=' + Date.now(); -} else { - urlTimestamp = '//' + host + '/api/timestamp?timestamp=' + Date.now(); -} - var data = [ { z: [[0, 0, 0], [0, 0, 0], [0, 0, 0]], @@ -28,6 +13,13 @@ var data = [ } ]; +var urlTimestamp = ''; +if (isLocalHost) { + urlTimestamp = '//' + host + ':3000/timestamp?timestamp=' + Date.now(); +} else { + urlTimestamp = '//' + host + '/api/timestamp?timestamp=' + Date.now(); +} + var layout = { autosize: false, margin: { diff --git a/html/maxhold/index.html b/html/maxhold/index.html index 35a6432..483b00f 100644 --- a/html/maxhold/index.html +++ b/html/maxhold/index.html @@ -94,6 +94,16 @@ - + + diff --git a/src/process/detection/CfarDetector1D.cpp b/src/process/detection/CfarDetector1D.cpp index 6d09e46..1913d98 100644 --- a/src/process/detection/CfarDetector1D.cpp +++ b/src/process/detection/CfarDetector1D.cpp @@ -35,6 +35,11 @@ Detection *CfarDetector1D::process(Map> *x) // loop over every cell for (int i = 0; i < nDopplerBins; i++) { + // skip if less than min Doppler + if (std::abs(x->doppler[i]) < minDoppler) + { + continue; + } mapRow = x->get_row(i); for (int j = 0; j < nDelayBins; j++) { @@ -43,6 +48,11 @@ Detection *CfarDetector1D::process(Map> *x) } for (int j = 0; j < nDelayBins; j++) { + // skip if less than min delay + if (x->delay[j] < minDelay) + { + continue; + } // get train cell indices std::vector iTrain; for (int k = j-nGuard-nTrain; k < j-nGuard; k++)