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.

IWR6843AOPEVM: Extracting dimensions from Gtrack Output through UART Terminal and view the dimensions in the python visualizer

Genius 9880 points
Part Number: IWR6843AOPEVM

Hi,

Customer want to know how to extract dim using UART, below is the details.

"I am currently using the People counting and the long range people detection demo in my IWR6843AoPEVM. I observed that there is a structure initialised in the gtrack.h header namely the GTRACK_targetDesc Struct Reference. This structure consists of a float variable called dim which stores the estimated target dimensions in width, height and depth. Could you please provide me some information on whether these are the physical dimensions of the target itself.

I would like to extract this specific value of dim through the UART terminal. Could you please provide me some information on the changes we would have to modify in the mss and dss files to send it through the output frame.

I would like to view the dimensions in the python visualizer as well if possible."

Thank you in advance.

Regards,
Maynard

  • The code for outputting the dimensions are already present. However teh section of the code is commented out. In the overhead tracker demo the values are populated as below - ti\mmwave_industrial_toolbox_4_7_0\labs\common\src\dpu\trackerproc_overhead\src\trackerproc_3d.c


    //targetList[n].dimX = targetDescr[n].dim[0];
    //targetList[n].dimY = targetDescr[n].dim[1];
    //targetList[n].dimZ = targetDescr[n].dim[2];


    The measurement spread is updated in gtrack_unitUpdate() [C:\ti\mmwave_industrial_toolbox_4_7_0\labs\common\src\dpu\trackerproc_overhead\packages\ti\alg\gtrack\src\gtrack_unit_update.c].
    The dimensions represent the spread around the centroid as below.

    /* Update measurement spread if we have 2 or more good points */
    if(myGoodPointNum > 1) {
    for(m = 0; m < MSIZE; m++) {
    spread = u_max[m] - u_min[m];
    /* Unbiased spread estimation */
    spread = spread*(myGoodPointNum+1)/(myGoodPointNum-1);
    /* computed spread extimation shall be between 1x and 2x of configured limits */
    if(spread > 2*inst->H_limits.array[m])
    spread = 2*inst->H_limits.array[m];
    if(spread < inst->H_limits.array[m])
    spread = inst->H_limits.array[m];

    if(spread > inst->estSpread.array[m])
    inst->estSpread.array[m] = spread;
    else {
    inst->estSpread.array[m] = (1.0f-inst->estSpreadAlpha)*inst->estSpread.array[m] + inst->estSpreadAlpha*spread;
    }
    }
    gtrack_calcDim(inst->estSpread.array, inst->uCenter.vector.range, inst->estDim);
    }


    This represents the dimensions of the object based on the spread of the points.

    Regards, 

    Sudharshan K N 

  • Hi Sudharshan K N,

    Thank you for your kind response. Customer have follow up questions, see items below.

    1. I am currently working with the 3D_People count wall mount demo and not the overhead one. Will the trackerproc_3d be invoked directly by the Gtrack algorithm in the 3D_People count wall mount demo as well ?


    2. I am currently using the python script oob_parser.py provided by TI for parsing the point cloud data received from the radar. I can observe that the decoding of 3D tracks is happening inside the function parseDetectedTracks3D in the file. Do I have to make any modifications inside the function to receive the dimensions of the target ? I have attached a screenshot below for your reference.

    Regards,
    Maynard

  • Hi Sudharshan K N,

    I just want to follow up my post above.

    Thank you in advance

    Regards,
    Maynard

  • Hi, 

    1. I am currently working with the 3D_People count wall mount demo and not the overhead one. Will the trackerproc_3d be invoked directly by the Gtrack algorithm in the 3D_People count wall mount demo as well ?

    In the 3D wall mount demo also uses the same overhead tracker. Please refer to ti\mmwave_industrial_toolbox_4_7_0\labs\people_counting\68xx_3D_people_counting\src\68xx_3D_people_count_mss.projectspec

    -I${COM_TI_MMWAVE_SDK_INSTALL_DIR}/packages/ti/alg/gtrack/lib
    -I${PC_PARENT_DIR}/common/src/dpu/trackerproc_overhead/lib
    -llibosal_xwr68xx.aer4f
    -llibesm_xwr68xx.aer4f

    For the second question the answer is yes. The TLV length will be updated as per the packet that is created. 

    Also here is some additional information From our expert on the usefulness of this dim values to approximate the detected object 

    This information can give us some idea about the target size but does not always reflect the physical dimensions.

    The spread parameter gives the distance between the max and min locations of all the associated points of a specific target. In the x-y domain, this information may reflect the target size in general. However, there are some cases where this data and the target size do not match. For example, when a person is sleeping, only a few points will be associated with the target around the torso (due to breathing), and the point cloud spread will be very small than the actual size. Besides, this information will be less accurate in the z domain (elevation) when the ISK type of antenna pattern is being used.

    Instead of looking at a single-frame snapshot, creating a multiple-frame window and look this spread data in the cumulative point cloud (across multiple frames). This approach can improve accuracy.

    Regards, 

    Sudharshan K N 

  • Hi Sudharshan K N,

    Thank you for your response. I just received a response from the customer. Below is the details.

    "
    1. I would like to print the dim along with the point cloud data for each track in the serial monitor or Command prompt of my PC. I am able to print the point cloud data and position (w.r.t to their X Y Z coordinates) of each track but I am not able to print the dim of each tracked target in the serial monitor. I have made the specific changes requested by you earlier by uncommenting the lines of code in the trackerproc_3d.c. Could you please put me in the right direction regarding this issue and provide me with information about the modifications to be made in the gui_main.py or oob_parser.py file.

    "

    Regards,
    Maynard

  • Hi, 

    Can you please let me know if the dims are not outputted at all or it doesn't appear always? if the number of detected point is just 1 then may be it may not output the values. 

    Regards, 

    Sudharshan K N 

  • Hi Sudharshan K N,

    According to customer, even when there are multiple targets detected by the 3D people count demo, the dimensions are not outputted in the Serial monitor.

    Regards,
    Maynard

  • Hi, 

    Thanks!! This may need further investigation from our end.  

    Regards, 

    Sudharshan K N 

  • Hi Sudharshan K N,

    Just want to follow up, may we know how long it takes for the investigation?

    Thank you in advance.

    Regards,
    Maynard

  • Hi, 

    The investigation is still pending. Will get back to you by end of next week, 

    Regards, 

    Sudharshan K N 

  • Hi, 

    Also please let me know if you were able to verify the values of dimension in the UART stream? 

    Regards, 

    Sudharshan K N 

  • Hi Sudharshan K N,

    Below is the response from customer.

    I was working with this for the past week and did not have any success with extracting the dimensions from the UART terminal. I did try to write my own function and mimic the functionality of TI's Calc_Dim function but unfortunately that did not work out as planned as well. Could you please let me know what the update from TI is regarding this issue ?

    Regards,
    Maynard

  • Hi, 

    Thanks for the info! Is the issue with the accuracy of the parameters reported OR they dont see this information coming out on the UART? 

    Regards, 

    Sudharshan K N 

  • Hi Sudharshan K N,

    Just received response from customer.

    Sorry for the confusion earlier, the issue is with the parameters not coming out of the UART itself and not with the accuracy of the same. I hope this answers your question.

    Regards,
    Maynard

  • Hi,

    Sorry for the delay. I think i understand where the confusion is coming from.

    The changes that were proposed is indeed correct. However the steps to include these changes vary based on the demo that is being used within the 3D people counting. All the demos use the same file \labs\common\src\dpu\trackerproc_overhead\src\trackerproc_3d.c file as mentioned in the earlier responses.

    The labs demo \labs\people_counting\68xx_3D_people_counting, uses the complied lib. This can be seen in the project spec file 68xx_3D_people_count_mss.projectspec
    -llibtrackerproc_xwr68xx.aer4f

    In order to get the changes recommended to be compiled into the code the customer first need to
    - rebuild the llibtrackerproc_xwr68xx.aer4f lib
    - rebuild the project again

    This should get the changes included. Alternatively they can include the trackerproc_3d.c into the project (along with the dependency files), make recommended changes and then we should be able to see the output.

    As an example in \labs\people_counting\overhead_3d_people_counting demo, the trackerproc_3d.c is directly included into the project. Here the additional steps of building the library is not needed. However the structure trackerProc_Target (trackerproc.h) doesnt have the members to store DIMs. The structure can be modified to include the additional needed variables. An example is shown below

    /*! @brief tracking ID */
    uint32_t tid;
    /*! @brief Detected target X coordinate, in m */
    float posX;
    /*! @brief Detected target Y coordinate, in m */
    float posY;
    /*! @brief Detected target Z coordinate, in m */
    float posZ;
    /*! @brief Detected target X velocity, in m/s */
    float velX;
    /*! @brief Detected target Y velocity, in m/s */
    float velY;
    /*! @brief Detected target Z velocity, in m/s */
    float velZ;
    /*! @brief Detected target X acceleration, in m/s2 */
    float accX;
    /*! @brief Detected target Y acceleration, in m/s2 */
    float accY;
    /*! @brief Detected target Z acceleration, in m/s2 */
    float accZ;
    /*! @brief Target Error covarience matrix, [4x4 float], in row major order, range, azimuth, elev, doppler */
    float ec[16];
    /*! @brief Gating function gain */
    float g;
    /*! @brief Tracker confidence metric*/
    float confidenceLevel;
    /*! @brief Detected target X dimensions, in m */
    float dimX;
    /*! @brief Detected target Y dimensions, in m */
    float dimY;
    /*! @brief Detected target Z dimensions, in m */
    float dimZ;


    #endif
    } trackerProc_Target;

    The same code changes recommended earlier to the file trackerproc_3D.c apply.

    for(n=0; n<tNum; n++) {
         targetList[n].tid = (uint32_t)targetDescr[n].uid;
         targetList[n].posX = targetDescr[n].S[0];
         targetList[n].posY = targetDescr[n].S[1];
         targetList[n].posZ = targetDescr[n].S[2];
    targetList[n].velX = targetDescr[n].S[3];
    targetList[n].velY = targetDescr[n].S[4];
    targetList[n].velZ = targetDescr[n].S[5];
    targetList[n].accX = targetDescr[n].S[6];
    targetList[n].accY = targetDescr[n].S[7];
    targetList[n].accZ = targetDescr[n].S[8];
    targetList[n].dimX = targetDescr[n].dim[0];
    targetList[n].dimY = targetDescr[n].dim[1];
    targetList[n].dimZ = targetDescr[n].dim[2];

    memcpy(targetList[n].ec, targetDescr[n].EC, sizeof(targetDescr[n].EC));
    targetList[n].g = targetDescr[n].G;


    To verify the changes I printed the DIMs to the console and i can see them getting populated. However I haven't modified the GUI test to get them out. Hope this helps.

    Regards,
    Sudharshan K N

  • Hi Sudharshan,

    I just received response from customer, below is the details.

    "I was looking into the proposed solution and made the changes recommended. However I was asked to include the trackerproc_3d.c into the project along with its dependency files. Could you please tell me if I would have to add the path of this file into the project specifications of the mss file ? or is there something else that I would have to do regarding this issue.

    I am trying to print the DIMs variable into the console window of CCS to check if they are getting populated when the program is running. It would be helpful if you could provide some information regarding this issue."

    Regards,
    Maynard

  • Hi, 

    \labs\people_counting\overhead_3d_people_counting demo, the trackerproc_3d.c is directly included into the project.

    Is this reference not enough to do the changes? Please let me know. 

    I am trying to print the DIMs variable into the console window of CCS to check if they are getting populated when the program is running. It would be helpful if you could provide some information regarding this issue

    The following lines of code can be added to the code to get the printouts of the DIMs. 

    /* BIOS/XDC Include Files. */
    #include <xdc/runtime/System.h>

    targetList[n].dimX = targetDescr[n].dim[0];
    targetList[n].dimY = targetDescr[n].dim[1];
    targetList[n].dimZ = targetDescr[n].dim[2];

    memcpy(targetList[n].ec, targetDescr[n].EC, sizeof(targetDescr[n].EC));
    targetList[n].g = targetDescr[n].G;

    targetList[n].confidenceLevel = targetDescr[n].confidenceLevel;

    System_printf ("Dims: x:%f,y:%f,z:%f\n",targetList[n].dimX,targetList[n].dimY,targetList[n].dimZ);

    Regards, 

    Sudharshan K N