-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add radar config for dream pcd
- Loading branch information
1 parent
22b2454
commit 9d6767f
Showing
5 changed files
with
205 additions
and
22 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
readObj: | ||
iqSwap: 0 | ||
numLane: 2 | ||
chInterleave: 1 | ||
dataSizeOneFrame: 196608 | ||
numAdcSamplePerChirp: 128 | ||
numChirpsPerFrame: 24 | ||
numTxForMIMO: 3 | ||
numRxForMIMO: 4 | ||
rangeFFTObj: | ||
radarPlatform: AWR1843Boosting | ||
rangeFFTSize: 128 | ||
dcOffsetCompEnable: 1 | ||
rangeWindowEnable: 1 | ||
FFTOutScaleOn: 0 | ||
scaleFactorRange: 0.03125 | ||
rangeResolution: 0.09375 | ||
maxRange: 6.0 | ||
dopplerFFTObj: | ||
dopplerFFTSize: 128 | ||
dopplerWindowEnable: 0 | ||
FFTOutScaleOn: 0 | ||
scaleFactorDoppler: 0.03125 | ||
velocityResolution: 1.165316453336068 | ||
maximumVelocity: 13.983797440032816 | ||
detectObj: | ||
detectMethod: 1 | ||
numAntenna: 12 | ||
refWinSize: | ||
- 8 | ||
- 4 | ||
guardWinSize: | ||
- 8 | ||
- 0 | ||
K0: | ||
- 5 | ||
- 3 | ||
maxEnable: 0 | ||
rangeBinSize: 0.09375 | ||
velocityBinSize: 0.10924841750025638 | ||
rangeFFTSize: 128 | ||
dopplerFFTSize: 128 | ||
powerThre: 0 | ||
discardCellLeft: 0 | ||
discardCellRight: 0 | ||
numRxAnt: 4 | ||
TDM_MIMO_numTX: 3 | ||
minDisApplyVmaxExtend: 10 | ||
applyVmaxExtend: 0 | ||
DOAObj: | ||
D: | ||
- - 0 | ||
- 0 | ||
- - 1 | ||
- 0 | ||
- - 2 | ||
- 0 | ||
- - 3 | ||
- 0 | ||
- - 2 | ||
- 1 | ||
- - 3 | ||
- 1 | ||
- - 4 | ||
- 1 | ||
- - 5 | ||
- 1 | ||
- - 4 | ||
- 0 | ||
- - 5 | ||
- 0 | ||
- - 6 | ||
- 0 | ||
- - 7 | ||
- 0 | ||
DOAFFTSize: 128 | ||
antenna_DesignFreq: 79000000000.0 | ||
antPos: | ||
- 0 | ||
- 1 | ||
- 2 | ||
- 3 | ||
- 4 | ||
- 5 | ||
- 6 | ||
- 7 | ||
- 8 | ||
- 9 | ||
- 10 | ||
- 11 | ||
antenna_azimuthonly: 0 | ||
antDis: 0.5117 | ||
method: 1 | ||
angles_DOA_azi: | ||
- -80 | ||
- 80 | ||
angles_DOA_ele: | ||
- -20 | ||
- 20 | ||
gamma: 1.0471285480508996 | ||
sidelobeLevel_dB: | ||
- 1 | ||
- 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
""" | ||
Author : Shelta Zhao(赵小棠) | ||
Email : xiaotang_zhao@outlook.com | ||
Copyright (C) : NJU DisLab, 2025. | ||
Description : DREAM-PCD pipeline to generate Point Cloud Data (PCD) from raw radar data. | ||
""" | ||
|
||
import os | ||
import sys | ||
import yaml | ||
import numpy as np | ||
from tqdm import tqdm | ||
|
||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../'))) | ||
from handler.param_process import get_radar_params | ||
from handler.adc_load import get_regular_data | ||
from module.fft_process import FFTProcessor | ||
from module.cfar_process import CFARProcessor | ||
from module.doa_process import DOAProcessor | ||
from utility.visualizer_box import PCD_display | ||
|
||
|
||
def dream_pcd_pipeline(adc_list, device, save=False, display=False): | ||
""" | ||
Generate Point Cloud Data (PCD) from raw radar data. | ||
Parameters: | ||
adc_list (str): The list of ADC data to be processed. | ||
device (str): The device to perform the computation on ('cpu' or 'cuda'). | ||
save (bool): Whether to save the results to a file. | ||
display (bool): Whether to display the results. | ||
Returns: | ||
point_cloud_data (np.ndarray): The generated Point Cloud Data (PCD) from the raw radar data. | ||
""" | ||
|
||
# Parse data config & Get radar params | ||
with open(f"{adc_list}.yaml", "r") as file: | ||
adc_list = yaml.safe_load(file) | ||
|
||
# Process each data in the list | ||
for adc_data in adc_list: | ||
|
||
# Print the current data info | ||
print(f"Processing data: {adc_data['prefix']} | {adc_data['config']} | {adc_data['radar']}") | ||
|
||
# Generate regular data & radar params | ||
data_path = os.path.join("data/adc_data", f"{adc_data['prefix']}/{adc_data['index']}") | ||
config_path = os.path.join("data/radar_config", adc_data["config"]) | ||
|
||
radar_params = get_radar_params(config_path, adc_data['radar']) | ||
regular_data, _ = get_regular_data(data_path, radar_params['readObj'], 'all', timestamp=True) | ||
|
||
# Update the radar parameters | ||
radar_params['detectObj']['refWinSize'] = [8,4] | ||
radar_params['detectObj']['guardWinSize'] = [8,0] | ||
radar_params['detectObj']['K0'] = [5,3] | ||
radar_params['detectObj']['discardCellLeft'] = 10 | ||
radar_params['detectObj']['discardCellRight'] = 20 | ||
|
||
# Generate all module instances | ||
fft_processor = FFTProcessor(radar_params['rangeFFTObj'], radar_params['dopplerFFTObj'], device) | ||
cfar_processor = CFARProcessor(radar_params['detectObj'], device) | ||
doa_processor = DOAProcessor(radar_params['DOAObj'], device) | ||
|
||
# Perform Range & Doppler FFT | ||
fft_output = fft_processor.run(regular_data) | ||
print(fft_output.shape) | ||
# Perform CFAR Detection | ||
cfar_output = cfar_processor.run(fft_output) | ||
print(cfar_output.shape) | ||
# Perform DOA Estimation | ||
doa_output = doa_processor.run(cfar_output) | ||
print(doa_output.shape) | ||
# Display the results | ||
if display: | ||
PCD_display(doa_output, radar_params['DOAObj']['angles_DOA_azi'], radar_params['DOAObj']['angles_DOA_ele']) |