This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

IWR6843ISK-ODS: 3D People Counting - Transmitting Heatmaps through UART

Part Number: IWR6843ISK-ODS

Tool/software:

Hi TI forum,

I have read through this forum and have tried to implement a way to transmit the range azimuth heatmap through UART:

AWR6843AOPEVM: Transmitting Float Data Type Heatmaps via UART in 3D People Counting Demo

Specifically, I am transmitting the data in heatMapOutFromDSP (which to my understanding, should be the variable inst->localHeatmap in 3D_people_tracking_demo_implementation_guide.pdf) 

I have taken the translated address and stored it on gMmwMssMCB.heatMapOutFromDSP.data

heatmapBuff = outputFromDSP->heatMapOut.data;
heatmapBuff = (float *)SOC_translateAddress((uint32_t)heatmapBuff,
                                        SOC_TranslateAddr_Dir_FROM_OTHER_CPU,
                                        &retVal);
// DebugP_log2("Pcount3DDemo_handleObjectDetResult: heatmap = (float *)0x%x, size = %d \n", (uint32_t)heatmapBuff, outputFromDSP->heatMapOut.dataSize );

gMmwMssMCB.heatMapOutFromDSP.dataSize = outputFromDSP->heatMapOut.dataSize;
gMmwMssMCB.heatMapOutFromDSP.data     = heatmapBuff; // outputFromDSP->heatMapOut.data;

Then in uart Task,

I have send the data in chunks of 8000 bytes in separate TLV headers, as I am unable to get it send over 40k bytes in one UART_write operation

/* Try send heatmap info */
if (gMmwMssMCB.heatMapOutFromDSP.datafmt == 0)
{
   uint8_t *dataPtr = (uint8_t *)gMmwMssMCB.heatMapOutFromDSP.data;
   uint32_t offset = 0;
   uint32_t chunkCount = 0;

   while (heatmapLength > 0)
   {
       uint32_t chunkSize = (heatmapLength > heatmapChunkSize) ? heatmapChunkSize : heatmapLength;

       tl.type   = 7777 + chunkCount;  // Different TL type for each chunk
       tl.length = chunkSize;

       heatmapErr1 = UART_write(uartHandle, (uint8_t *)&tl, sizeof(MmwDemo_output_message_tl));
       heatmapErr2 = UART_write(uartHandle, dataPtr + offset, chunkSize);

       offset += chunkSize;
       heatmapLength -= chunkSize;
       chunkCount++;

       DebugP_log3("MmwDemo_uartTxTask, heatmapErr1 = %d, heatmapErr2 = %d, length = %d\n", (uint32_t)heatmapErr1, (uint32_t)heatmapErr2, heatmapLength);
   }
}

Based on the configuration file I used, I am expecting the heatmap size to be of 47872 bytes (range bins * angle bins * 4, 64 * 187 * 4) which would be 11968 floats. 

This matches with what the variable gMmwMssMCB.heatMapOutFromDSP.dataSize contains

% SDK Parameters
% See the SDK user's guide for more information
% "C:\ti\mmwave_sdk_[VER]\docs\mmwave_sdk_user_guide.pdf"
sensorStop
flushCfg
dfeDataOutputMode 1
channelCfg 15 7 0
adcCfg 2 1
adcbufCfg -1 0 1 1 1
lowPower 0 0

% Detection Layer Parameters
% See the Detection Layer Tuning Guide for more information
% "<RADAR_TOOLBOX_INSTALL_DIR>\source\ti\examples\People_Tracking\docs\3D_people_tracking_detection_layer_tuning_guide.pdf"
profileCfg 0 60.75 30.00 25.00 59.10 657930 0 54.71 1 64 2950.00 2 1 36 
chirpCfg 0 0 0 0 0 0 0 3
chirpCfg 1 1 0 0 0 0 0 3
chirpCfg 2 2 0 0 0 0 0 4
bpmCfg -1 1 0 1
frameCfg 0 2 96 0 600.0 1 0
dynamicRACfarCfg -1 4 4 2 2 8 12 4 12 5.00 8.00 0.40 1 1
staticRACfarCfg -1 6 2 2 2 8 8 6 4 8.00 15.00 0.30 0 0
dynamicRangeAngleCfg -1 0.75 0.0010 1 0
dynamic2DAngleCfg -1 3.0 0.0300 1 0 1 0.30 0.85 8.00
staticRangeAngleCfg -1 0 8 8
antGeometry0 0 0 -1 -1 -2 -2 -3 -3 -2 -2 -3 -3
antGeometry1 0 -1 -1 0 0 -1 -1 0 -2 -3 -3 -2
antPhaseRot 1 -1 -1 1 1 -1 -1 1 1 -1 -1 1
fovCfg -1 70.0 70.0
compRangeBiasAndRxChanPhase 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

% Tracker Layer Parameters
% See the Tracking Layer Tuning Guide for more information
% "C:\ti\radar_toolbox_[VER]\source\ti\examples\People_Tracking\docs\3D_people_tracking_tracker_layer_tuning_guide.pdf"
staticBoundaryBox -3 3 0.5 7.5 0 3
boundaryBox -4 4 0 8 0 3
sensorPosition 1.5 0 0
gatingParam 3 2 2 3 4
stateParam 3 3 12 500 5 500
allocationParam 50 100 0.1 30 0.5 20
maxAcceleration 0.1 0.1 0.1
trackingCfg 1 2 800 20 46 96 55
presenceBoundaryBox -3 3 0.5 7.5 0 3
sensorStart

What I received from the PC using python looks like this:

I have arranged the data in the format of [azimuth][range] (187, 64)

Within this range of data, there exists very high and very low float values. The heatmap looks static and unchanging

I used np.log10 to figure out what I am looking at:

And after filtering out the first few and last few ranges -> [0:187, 4:60]

It appears that this is the range azimuth heatmap.

But I do not know what are those other values contained within this memory space

My main question is:

Why is the size of the heatmap not what I understood to be 47872 bytes? Am I misinterpreting how this heatmap is stored? Is it not in the form of (187, 64) arrangement?

Thank you for reading!

Shi Xiang

  • Hi Shi Xiang,

    if your numADCSamples is 64 then you should have 64 range bins so I believe your assumption is correct regarding the size of the heatmap. It seems that there is some erroneous data in the first and last few range bins. Please let me check if there have been reported/noticed before and get back to you. Can you also confirm the version in the radar toolbox that you're using and if these are the only modifications that you have made?

    Best Regards,

    Josh

  • Hi Josh!

    I am using radar_toolbox_2_10_00_04.  Here is the properties screen for the ARM compiler for mss project

    I have not modified any dss code, and only modified in mss_main.c. 

    The only other code I left out was counting the number of tlvs to send in the UART packet:

    if (gMmwMssMCB.heatMapOutFromDSP.datafmt == 0)
    {
        heatmapLength = (gMmwMssMCB.heatMapOutFromDSP.dataSize * 4);  // Number of floats * bytes per float
    
        // Calculate the total number of TLVs needed for the heatmap data
        while (heatmapLength > 0)
        {
            uint32_t chunkSize = (heatmapLength > heatmapChunkSize) ? heatmapChunkSize : heatmapLength;
            packetLen += sizeof(MmwDemo_output_message_tl) + chunkSize;
            heatmapLength -= chunkSize;
            heatmapTLVCount++;
    
            tlvIdx++;
        }
    
        heatmapLength = (gMmwMssMCB.heatMapOutFromDSP.dataSize * 4);  // Reset heatmapLength for the actual transmission
    }

    I have also checked and saved the memory from the memory browser and have gotten the same output from my uart packets.

  • Update:

    I found this part of the processing in radarprocess.c:

    for (i = processInst->cfarRangeSkipLeft; i < processInst->numRangeBins - processInst->cfarRangeSkipRight; i++)
    {
        processInst->aoaInput->rangeIndx = i;
        
        /* rearrange the circular buffer in the fine motion mode and copy back to the main radar cube*/
        if (processInst->fineMotionActive)
        {
            /* copy the first part */
            memcpy(&pDataIn[i * processInst->nRxAnt * processInst->aoaInput->nChirps], &pDataIn[(i + processInst->numRangeBins) * processInst->nRxAnt * processInst->aoaInput->nChirps + nSamplesPerRangeFirstPart], nSamplesPerRangeSecondPart * sizeof(cplx16_t));
        
            /* copy the second part */
            memcpy(&pDataIn[i * processInst->nRxAnt * processInst->aoaInput->nChirps + nSamplesPerRangeSecondPart], &pDataIn[(i + processInst->numRangeBins) * processInst->nRxAnt * processInst->aoaInput->nChirps], nSamplesPerRangeFirstPart * sizeof(cplx16_t));
        }
        
        processInst->aoaInput->inputRangeProcOutSamples = &pDataIn[i * processInst->nRxAnt * processInst->aoaInput->nChirps];
        processInst->aoaOutput->rangeAzimuthHeatMap     = processInst->tempHeatMapOut;
        // has to be set to indicate the last rb to process, so that buffer init will be done correctly inside module, only needed for dynamic processing.
        if (i == (processInst->numRangeBins - processInst->cfarRangeSkipRight - 1))
            processInst->aoaInput->lastRB2Process = 1;
        processInst->aoaBFErrorCode = RADARDEMO_aoaEst2DCaponBF_run(
            processInst->aoaInstance,
            processInst->aoaInput,
            processInst->aoaOutput);
        
        // transpose and store
        copyTranspose((uint32_t *)&processInst->tempHeatMapOut[0], (uint32_t *)&processInst->localHeatmap[i], processInst->numDynAngleBin, 0, processInst->numRangeBins, 1);
    }


    Then, I found that the issue is caused by my cfar configuration:

    dynamicRACfarCfg <subFrameIdx> <cfarDiscardLeftRange> <cfarDiscardRightRange> <cfarDiscardLeftAngle> <cfarDiscardRightAngle> ...

    By setting all the discards to zero, the heatmap now looks fine. Sorry for the trouble josh, and thank you for looking into this

    Best,

    Shi Xiang

  • Hi Shi Xiang, 

    No problem! I'm glad the issue is resolved. 

    Best Regards,

    Josh