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.

IWR1642BOOST: Send only closest object information for MMWAVE Lab

Part Number: IWR1642BOOST
Other Parts Discussed in Thread: IWR1642

Hi,

I am developing an application based on the mmwave lab sample code, which is used along the High Accuracy Visualizer application. I am able to receive the data and view the objects in the High Accuracy Visualizer web page. Now I want to modify the data transmitted such that, only the information of the closest detected object is transferred. I am assuming MmwDemo_transmitProcessedOutput() function is the one which actually sends the data over UART. I am confused about the following code section:

/* Send detected Objects */
{
MmwDemo_output_message_dataObjDescr descr;
MmwDemo_detectedObj dummyDetectionOut; //work around the current format
int32_t tempRange;

memset((void *)&dummyDetectionOut, 0, sizeof(MmwDemo_detectedObj));

tempRange = (int32_t)(outputData->rangeEst * 1048576.f);

dummyDetectionOut.dopplerIdx = 0;
dummyDetectionOut.peakVal = 0;
dummyDetectionOut.rangeIdx = (uint16_t) tempRange & 0xFFFF;
dummyDetectionOut.x = tempRange >> 16;
dummyDetectionOut.y = 0;
dummyDetectionOut.z = 0;

UART_writePolling (uartHandle,
(uint8_t*)&tl[tlvIdx],
sizeof(MmwDemo_output_message_tl));
/* Send objects descriptor */
descr.numDetetedObj = 1;
descr.xyzQFormat = 20;
UART_writePolling (uartHandle, (uint8_t*)&descr, sizeof(MmwDemo_output_message_dataObjDescr));

/*Send array of objects */
UART_writePolling (uartHandle, (uint8_t*)&dummyDetectionOut, sizeof(MmwDemo_detectedObj) * 1);
tlvIdx++;
}

Here, it looks like only one object's data is being sent which is based on "rangeEst" value.

1. What is the significance of this parameter?

2. Why is it multiplied by 1048576.f?

3. In the graphs displayed in High Accuracy Visualizer, it seems to contain data about multiple objects. How can I identify the closest detected object in MmwDemo_transmitProcessedOutput() function so that I need to send only that information over UART.

Thanks and Regards

Ison Thomas

  • Hi Ison,

    The High Accuracy lab uses a peak finder function to find the largest peak in the scene. This computation is performed at code level before the post-processed data has been sent over UART.

    If you are looking to find multiple objects then you'll need to implement your own peak finder function in the c code.

    Cheers,

    Akash

  • Hi Akash,

    I don't want to detect multiple objects. I want to find the distance of the closest object in the direction perpendicular to the plane of board. 

    1. What is the logic used behind the peak finder function currently used?

    2. When viewing data in High Accuracy Visualizer webpage we can see peaks at multiple distances in the graph. How does the webpage arrive at this data using the data transferred from the mmwave?

    -Ison Thomas

  • Hi Ison,

    The Range Profile is representative of the first dimension FFT which results in range information. The High Accuracy algorithm then performs another FFT to zoom in on a peak and determine the range of a single object with high accuracy. This is all performed on-chip before the post-processed data is transmitted to the visualizer. This is actually described in the High Accuracy User Guide.

    Cheers,

    Akash

  • Hi Akash,

    Pardon my ignorance of the math behind the range calculation. I am trying to get a quick solution, purely from a programmers perspective, for range calculation using IWR1642. What I have done so far is to take the high accuracy demo code provided with the sdk and start the range measurement with the following cli commands:

    dfeDataOutputMode 1
    channelCfg 1 1 0
    adcCfg 2 1
    adcbufCfg 0 1 1 1
    profileCfg 0 77 7 7 114.4 0 0 33.71 1 512 5000 0 0 48
    chirpCfg 0 0 0 0 0 0 0 1
    frameCfg 0 0 10 0 500 1 0
    lowPower 0 1
    guiMonitor 1 1 0 0 0 1
    RangeLimitCfg 2 1 0.1 15.0
    sensorStart

    I don't want to send the cli commands each time the board powers up. So I have modified the cli utility as mentioned in https://e2e.ti.com/support/sensors/f/1023/t/741521 to hard-code the above mentioned commands/ When the board powers up, these commands are taken automatically and the measurement begins. Each time the board powers up, I can see data transmitted in the default format over UART.

    Now, I don't want the full information send by the demo code for my solution. I just want the distance at which the closest object is detected (or in this case, the distance of the object selected by the iwr algorithm). I want to reduce the packet transmitted over UART to contain the minimum information needed : a start sequence, detected object's distance and a crc for data validation. So I believe I have to modify the MmwDemo_transmitProcessedOutput function to send my data instead of the default transmitted data. I am trying to figure out how the distance of the object is calculated in this function and I have some doubts here. The code section is pasted below:

        /* Send detected Objects */
        {
            MmwDemo_output_message_dataObjDescr descr;
            MmwDemo_detectedObj dummyDetectionOut; //work around the current format
            int32_t tempRange;
    
            memset((void *)&dummyDetectionOut, 0, sizeof(MmwDemo_detectedObj));
    
            tempRange                       =   (int32_t)(outputData->rangeEst * 1048576.f);
    
            dummyDetectionOut.dopplerIdx    =   0;
            dummyDetectionOut.peakVal       =   0;
            dummyDetectionOut.rangeIdx      =   (uint16_t) tempRange & 0xFFFF;
            dummyDetectionOut.x             =   tempRange >> 16;
            dummyDetectionOut.y             =   0;
            dummyDetectionOut.z             =   0;
    
            UART_writePolling (uartHandle,
                               (uint8_t*)&tl[tlvIdx],
                               sizeof(MmwDemo_output_message_tl));
            /* Send objects descriptor */
            descr.numDetetedObj = 1;
            descr.xyzQFormat = 20;
            UART_writePolling (uartHandle, (uint8_t*)&descr, sizeof(MmwDemo_output_message_dataObjDescr));
    
            /*Send array of objects */
            UART_writePolling (uartHandle, (uint8_t*)&dummyDetectionOut, sizeof(MmwDemo_detectedObj) * 1);
            tlvIdx++;
        }

    For my testing, I have fixed the position of iwr1642 board and the reflecting object. When I use the default code without any modification and use the High Accuracy Visualizer, it shows the object detected at 1.98 meters. Now I want to arrive at this value from the code itself and just send only this value over UART.

    I assume the variable "tempRange" is holding the key here. This value for tempRange in my testing comes to around 2082187. dummyDetectionOut.rangeIdx = tempRange & 0xFFFF comes around 50571 and dummyDetectionOut.x = tempRange >> 16 comes around 31. (The values varies slightly for each data transferred)

    I thought dummyDetectionOut.rangeIdx gives the distance at which the object is detected. What exactly is this value? The documents mentions it as range, in which case I expect it to be some where around the 1.98 meter value?

    dummyDetectionOut.y and dummyDetectionOut.z is hard-coded to 0. Shouldn't they have a value there?

    The descr.xyzQFormat is hardcoded to 20. I have referred to https://e2e.ti.com/support/sensors/f/1023/t/630120 to understand QFormat. According to this my calculation of actual X value will be 31/2^20. This does not make any sense. Is this correct?

    Kindly help me in understanding how the calculation is made to arrive at the 1.98meters in the High Accuracy Visualizer.

    Regards

    Ison Thomas