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.

AWR1843BOOST: How to calculate the angle from the MmwDemo_detectedObjActual_t or MmwDemo_objRaw2D

Expert 2050 points
Part Number: AWR1843BOOST

 in dss side, I am trying to filter some objects out which are not inside the defined azimuth angle range or elevation angle range. I find MmwDemo_detectedObjActual_t which has the x, y, z coordinate value.  

/*!
 *  @brief    Parameters of CFAR detected object during the second round of
 *  CFAR detections.
 *
 */
typedef struct MmwDemo_objRaw2D
{
    uint16_t   rangeIdx;     /*!< @brief Range index */
    uint16_t   dopplerIdx;   /*!< @brief Doppler index */
    uint16_t   range;        /*!< @brief Range (in meters * (1 << xyzOutputQFormat)) */
    int16_t   speed;        /*!< @brief relative velocity (in meters/sec * (1 << xyzOutputQFormat)) */
    uint16_t   peakVal;      /*!< @brief Peak value */
    uint16_t   rangeSNRdB;     /*!< @brief SNR of the peak in the range dimension */
    uint16_t   dopplerSNRdB;   /*!< @brief SNR of the peak in the doppler dimension */
} MmwDemo_objRaw2D_t;

/*!
 *  @brief    Detected object estimated parameters.
 *
 */
typedef struct MmwDemo_detectedObjActual_t
{
    uint16_t   rangeIdx;            /*!< @brief Range index */
    uint16_t   dopplerIdx;          /*!< @brief Doppler index */
    
    uint16_t   range;               /*!< @brief Range (meters in oneQformat) */
    int16_t    speed;               /*!< @brief Doppler (m/s in oneQformat) */
    int16_t    sinAzim;             /*!< @brief wx  sin(Azim).  Q format provides the bitwidth. */
    
    uint16_t   peakVal;             /*!< @brief Peak value */
    
    uint16_t   rangeSNRdB;          /*!< @brief Range SNR (dB)  */
    uint16_t   dopplerSNRdB;        /*!< @brief Doppler SNR (dB) */
    uint16_t   sinAzimSNRLin;       /*!< @brief omega SNR (linear scale) */
    
    int16_t  x;             /*!< @brief x - coordinate in meters. Q format provides the bitwidth. */
    int16_t  y;             /*!< @brief y - coordinate in meters. Q format provides the bitwidth. */
    int16_t  z;             /*!< @brief z - coordinate in meters. Q format provides the bitwidth. */
    
} MmwDemo_detectedObjActual;

I would like to know if we can calculate the angle base on the x, y, z of MmwDemo_detectedObjActual_t?

  • Hi Lei,

              You can probably use the function  AoAProcHWA_XYZestimation in C:\ti\mmwave_sdk_03_05_00_04\packages\ti\datapath\dpc\dpu\aoaproc\src\aoaprochwa.c mmWave SDK 3.5 to back track and calculate this. Also, there is the heading in docs folder C:/ti/mmwave_sdk_03_05_00_04/packages/ti/datapath/dpc/dpu/aoaproc/docs/doxygen/html/index.html Data Path - Direction of Arrival Estimation (x,y,z) where the calculation is done.

               Request you to please go through this and let me know if I have any questions.

    Thanks and Regards,

    Akshay

  • Akshay, Thank you very much!

    If we just want to simply remove the objects that are not in the defined detection zone, can I do that in the function rangeBasedPruning() in dss_data_path.c? For example, I want to remove the objects if their x is larger x_range, y is larger than y_range and z is larger than z_range, then can I add code before assigning objRaw to objOut as I added in below code?

    uint32_t rangeBasedPruning(
        MmwDemo_detectedObjActual*  restrict objOut,
        MmwDemo_objRaw2D_t * restrict objRaw,
        RangeDependantThresh_t * restrict SNRThresh, 
        RangeDependantThresh_t * restrict peakValThresh, 
        uint32_t numDetectedObjects,
        uint32_t numDopplerBins,
        uint32_t maxRange,
        uint32_t minRange)
    {
        ...
        for (i = 0; i < numDetectedObjects; i++)
        {
            if ((objRaw[i].range <= maxRange) && ((objRaw[i].range >= minRange)))
            {
                ...
                            
                if ( (objRaw[i].rangeSNRdB > SNRThresh[j].threshold) && 
                     (objRaw[i].peakVal > peakValThresh[k].threshold) )
                {
    /******************************************************************************                
                    Add function to check if objOut.x, objOut.y and objOut.z are in the zone we defined.
                    ex. 
                  
                    uint_8 xyzQformat = 7;
                    int_16 x_range = 2;
                    int_16 y_range = 10;
                    int_16 z_range = 1;
                    int_16 xval = objOut.x/(1<<xyzQformat);
                    int_16 yval = objOut.y/(1<<xyzQformat);
                    int_16 zval = objOut.z/(1<<xyzQformat);
                    
                    if( xval<x_range && yval<y_range && zval<z_range)
                    {
    *******************************************************************************/  
                        objOut[numObjOut].rangeIdx      = objRaw[i].rangeIdx;
                        objOut[numObjOut].dopplerIdx    = objRaw[i].dopplerIdx;
                        objOut[numObjOut].range         = objRaw[i].range;
                        objOut[numObjOut].speed         = objRaw[i].speed;
                        objOut[numObjOut].peakVal       = objRaw[i].peakVal;
                        objOut[numObjOut].rangeSNRdB    = objRaw[i].rangeSNRdB;
                        objOut[numObjOut].dopplerSNRdB  = objRaw[i].dopplerSNRdB;        
                        numObjOut++;
                    }
                    if (numObjOut == MRR_MAX_OBJ_OUT)
                    {
                        break;
                    }
                }
               
            }
        }
        return numObjOut;
    }

    I tried above code, but it seems the objOut.x/(1<<xyzQformat), objOut.y/(1<<xyzQformat), objOut.z/(1<<xyzQformat) doesn't give object's actual coordinates. 

    Kind regards

  • Hi Lei,

             Thanks for your patience. Yes you must be able to achieve what you want by putting the if condition.

              So are you saying you are not getting the proper output after making changes in the code (by addition of if condition for defined detection zone).

             Let me know if you have any questions.

    Thanks and Regards,

    Akshay