Tool/software:
Hey,
Our objective is to identify where the point cloud values (x, y, z, velocity) are set in the SDK code so we can correctly add and use rangeIdx and dopplerIdx in the processing pipeline.
We are using an AWR2944PEVM board with the a modified version of the awr2x44P_mmw_demoTDMEnet.appimage demo loaded from the SDK mmwave_mcuplus_sdk_04_07_01_04. The code we have modified is the DPIF_PointCloudCartesian struct to contain rangeIdx and dopplerIdx information:
typedef struct DPIF_PointCloudCartesian_t
{
float x;
float y;
float z;
float velocity;
int16_t rangeIdx; /* NEW */
int16_t dopplerIdx; /* NEW */
}DPIF_PointCloudCartesian;
The reason for this addition is that later on in the processing pipeline we want to collect doppler data around each detected point and send it over ethernet. My question is then: where in the code are the x, y, z and velocity values being set? I have located some possible places and placed dummy values, such as on row 1903 in aoaprochwa.c:
objOut[objOutIdx].x = x;
objOut[objOutIdx].y = y;
objOut[objOutIdx].z = z;
objOut[objOutIdx].velocity = params->dopplerStep * (float)dopplerIdx;
objOut[objOutIdx].rangeIdx = 10; /* DUMMY VALUE SET HERE */
objOut[objOutIdx].dopplerIdx = 10; /* DUMMY VALUE SET HERE */
objOutSideInfo[objOutIdx].noise = objIn[objInIdx].noise;
objOutSideInfo[objOutIdx].snr = objIn[objInIdx].snr;
res->detObj2dAzimIdx[objOutIdx] = (uint8_t)maxIdx;
and around row 2870 in aoaprochwa.c:
for(idx=0; idx < numObjsIn; idx++)
{
range = (float)res->cfarRngDopSnrList[idx].rangeIdx * DPParams->rangeStep;
res->detObjOut[idx].y = range;
res->detObjOut[idx].x = 0.0F;
res->detObjOut[idx].z = 0.0F;
temp = AOA_DOPPLER_IDX_TO_SIGNED(res->cfarRngDopSnrList[idx].dopplerIdx, DPParams->numDopplerBins);
res->detObjOut[idx].rangeIdx = 20; /* DUMMY VALUE SET HERE */
res->detObjOut[idx].dopplerIdx = 20; /* DUMMY VALUE HERE */
res->detObjOut[idx].velocity = DPParams->dopplerStep * (float)temp;
res->detObjOutSideInfo[idx].snr = res->cfarRngDopSnrList[idx].snr;
res->detObjOutSideInfo[idx].noise = res->cfarRngDopSnrList[idx].noise;
}
However, when debugging using CCS 20.2.0, I get the following output:
Cortex_R5_0: Point: [0.053103, -0.066911, 0.000000] -0.406067 m/s
Cortex_R5_0: CFAR: RangeIdx: 1698, DopplerIdx: 16125
Cortex_R5_0: Point: [0.418488, 0.000000, 1.457062] 1.930595 m/s
Cortex_R5_0: CFAR: RangeIdx: 22879, DopplerIdx: -16531
Cortex_R5_0: Point: [0.000000, 0.000000, 0.000000] 0.000000 m/s
Cortex_R5_0: CFAR: RangeIdx: 0, DopplerIdx: 0
This seems like random/garbage values from uninitialized variables. Due to these garbage values, I suspect the values for x,y,z and velocity are being set somewhere else in the code and not in the places I located. I would be very grateful if someone could help solve this issue or point me to where the x,y,z and velocity are being set.
The config I am using is the following:
% ***************************************************************
% Created for SDK ver:04.07
% Created using Visualizer ver:4.7.0.0
% Frequency:77
% Platform:AWR2X44P
% Scene Classifier:best_range_res
% Azimuth Resolution(deg):15 + Elevation
% Range Resolution(m):0.04
% Maximum unambiguous Range(m):9.02
% Maximum Radial Velocity(m/s):1
% Radial velocity resolution(m/s):0.13
% Frame Duration(msec):100
% RF calibration data:None
% Range Detection Threshold (dB):15
% Doppler Detection Threshold (dB):15
% Range Peak Grouping:enabled
% Doppler Peak Grouping:enabled
% Static clutter removal:disabled
% Angle of Arrival FoV: Full FoV
% Range FoV: Full FoV
% Doppler FoV: Full FoV
% ***************************************************************
sensorStop
flushCfg
dfeDataOutputMode 1
channelCfg 15 11 0 0 0
adcCfg 2 0
adcbufCfg -1 1 1 1 1
lowPower 0 0
profileCfg 0 77 267 2.5 57.14 0 0 70 1 272 5070 0 0 30
chirpCfg 0 0 0 0 0 0 0 1
chirpCfg 1 1 0 0 0 0 0 2
chirpCfg 2 2 0 0 0 0 0 8
frameCfg 0 2 16 0 272 100 1 0
lowPower 0 0
guiMonitor -1 1 1 0 0 0 1
antGeometryCfg 1 0 1 2 1 7 1 9 1 3 1 5 1 10 1 12 1 6 1 8 1 13 1 15 0 9 0 11 0 16 0 18 0.5 0.5
cfarCfg -1 0 2 8 4 3 0 15 1
cfarCfg -1 1 0 4 2 3 1 15 1
multiObjBeamForming -1 1 0.5
calibDcRangeSig -1 0 -5 8 256
clutterRemoval -1 0
cfarFovCfg -1 0 0 30
cfarFovCfg -1 1 -1 1.00
compRangeBiasAndRxChanPhase 0.0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
extendedMaxVelocity -1 0
measureRangeBiasAndRxChanPhase 0 1.5 0.2
aoaFovCfg -1 -90 90 -90 90
calibData 0 0 0
enetStreamCfg 1 192 168 1 10
sensorStart