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.

IWR1642:Code fixes for the Angle between radar vehicle detector installation and lane line

Other Parts Discussed in Thread: IWR1642

Hello,

           IWR1642 is used for radar vehicle detection,IWR1642 mounted electronic police lever is crooked,As a result, IWR1642 is not positively aligned with the roadAs a result,How to convert the point cloud data,I think this affects the azimuth of the test point. How can I fix this in the code?

           Suppose IWR1642 is mounted 10 degrees off the lane, the arithmetic operation: azimuth = azimuth + 10?Or azimuth = azimuth - 10?

  • The point cloud data structure is as follows:

  • /* The struct used as point cloud data parameters */
    typedef struct Mmw_message_point_t
    {
    /*! @brief Detected point range, in m */
    float range;
    /*! @brief Detected point azimuth, in rad */
    float azimuth;
    /*! @brief Detected point doppler, in m/s */
    float doppler;
    /*! @brief Range detection SNR, linear */
    float snr;
    } Mmw_message_point;
  • Hello

    You would have to look into the Code to understand how these values are computed and  do the desired offset changes/modification there.

    Please see the doxygen for the OOB to get an understanding of various code blocks

     typically at : : file:///C:/ti/mmwave_sdk_03_04_00_03/packages/ti/demo/xwr68xx/mmw/docs/doxygen/html/index.html

    THank you,

    Vaibhav

  • Hello

            I have seen the configuration in the tool tm_demo.exe provided by you. Is it the configuration of the Angle correction parameter described in my question?The diagram below:

  • Hello

    Please help us understand the which demo/lab are you using.

    Typically the GUI demo  value for adjusting the tilt of the EVM and not  for the offset of the device location.

    It will also help if you  show example of what you see vis what you expect

    Thank you,

    Vaibhav

  • Hello,

    The TI document I refer to is tracking_radar_targets_with_multiple_reflection_points.pdf,

    As shown in the figure above, the Angle between the radar coordinate axis and the horizontal coordinate axis is α, and the Angle of the target point pointn relative to the radar coordinate axis is φn,

    Then the point cloud data of IWR1642 with data type MMWDEMO_OUTPUT_MSG_POINT_CLOUD is obtained, and the main data structure is as follows:

    /* The struct used as point cloud data parameters */
    typedef struct Mmw_message_point_t
    {
    /*! @brief Detected point range, in m */
    float range;
    /*! @brief Detected point azimuth, in rad */
    float azimuth;
    /*! @brief Detected point doppler, in m/s */
    float doppler;
    /*! @brief Range detection SNR, linear */
    float snr;
    } Mmw_message_point;

    Have the following questions:

    1. IWR1642 Working reflection point obtains the value of φnthat azimuth represents?Or is it the value of φn + α?

    2. I use the corresponding algorithm in TI document Tracking_Radar_Targets_With_Multiple_Reflection_Points

    The interface to get the vehicle target is as follows:

    gtrack_step(gtrackHandle,

    (GTRACK_measurementPoint *)ptr,

    NULL,

    iNum,

    targetDescr,

    &tNum,

    NULL,

    NULL);

    The structure of PTR is as follows,

    typedef struct

    {

    /** @brief Range, m */

    float range;

    /** @brief Angle, rad */

    float angle;

    /** @brief Radial velocity, m/s */

    float doppler;

    /** @brief Range detection SNR, linear */

    float snr;

    } GTRACK_measurementPoint;

    What is the value ptr-> Angle that the input parameter passes in?Is it φn + α?

    3. As in the example above, the radar coordinate axis rotates α clockwise relative to the horizontal coordinate axis. If it rotates α counterclockwise, the input parameter PTR-> is passed in and Angle is φn-α?

  • Hello,

    Can you please confirm which 

        1) Prebuilt binary

        2) CFG file 

    You are basing your project on? This will let me know if there are some easier modifications to make.

    But in general it sounds like you want to simply modify the angular position of the point cloud and tracked objects? It is probably easiest to do this outside of the GTRACK algorithm, and before the UART transmission. This will make sure the algorithm works as intended. 

    Currently, this is how our demos function, but they account for sensor tilt in the GUI, outside of the embedded processing. But it could be added to the UART task in MSS_main fairly easily.

    Please let me know if you have additional questions.

    Regards,

    Jackson

  • Hello,

    1. First of all, I would like to confirm whether the three questions I raised above and the calculation related to the Angle I understand are correct,That's the key, please let me know.

    2. Can we solve this problem by configuring the CFG file outside the algorithm?You don't have to change any of the algorithms, right?How should I change it?

    3. As described in my picture, I want to simply modify the Angle position of the point cloud and the tracked object. The current idea is, besides the Gtrack algorithm, to perform the Azimuth Angle calculation after receiving a complete frame of point cloud data, and then transmit it to the Gtrack algorithm;

    4. How do I change MSS_main to implement it?

    Please help me solve my doubts in these four points. Thank you!

  • Hello,

             Let me add to that last question,

    The following is my handling method, please help me to check whether it is correct.

    for(i = 0 ; i < ui32PointSize ; i ++)
    {
    memcpy(&g_pointmsg[i],
    &sRadarDataBuf.u8RadarDataBuf[ui32TmpPos+i*sizeof(Mmw_message_point)],
    sizeof(Mmw_message_point));


    memcpy(&fazimuth1,&sRadarDataBuf.u8RadarDataBuf[ui32TmpPos+i*sizeof(Mmw_message_point)+sizeof(float)],sizeof(float));
    fazimuth1 = fazimuth1 + 0.017 * cOffsetAngle;//0.017 = π/180
    g_pointmsg[i].azimuth = fazimuth1;
    }

    SetPointData(g_pointmsg,ui32PointSize);

    void SetPointData(Mmw_message_point *ptr, int iNum)
    {
    ........
    gtrack_step(gtrackHandle,
    (GTRACK_measurementPoint *)ptr,
    NULL,
    iNum,
    targetDescr,
    &tNum,
    NULL,
    NULL);

    ........

    }

    explain:

    My Angle code migration implementation is as follows, sRadarDataBuf u8RadarDataBuf used to store after receiving the complete a frame contains Mmw_message_point structure of point cloud data, the number of point cloud data for ui32PointSize,

    & sRadarDataBuf. U8RadarDataBuf [ui32TmpPos + I * sizeof (Mmw_message_point) + sizeof (float)] for radar azimuth reflection point storage address,

    azimuth1 = fazimuth1 + 0.017 * cOffsetAngle;//0.017 is equal to π/180. CoffSetAngle represents the offset Angle α of the detector relative to the horizontal coordinate system. Referring to α in the diagram above, this Angle variable is configured by the upper computer according to the actual horizontal offset.The purpose of this sentence is to correct the azimuth Angle;

    g_pointmsg[i].azimuth = fazimuth1;//Write back the corrected fazimuth1 parameter.

    g_pointmsg Is the ptr argument passed to the gtrack step function.

    So, am I doing the calculation right, dealing with the deviation of the Angle?If not, how can you correct it?

  • Hello

    Helping you with code modification and review is out of the scope of forum support.

    As suggested multiple times in the responses  please follow the following process:

    1. Use data from the device  (x,y.z information)  as is and then add correction based on application orientation  on top of that data.  Do this outside the device - get the formula right.

    2. Then add the adjusted formula to the  C code on the device:  (Find the tracker result block and add a modifier from #1  to C code )

    We can help you identify if the device data comprehends for the GUI angle/orientation parameters, however you may be able to identify this  by changing the angle setting in GUI and observing if the device data changes based on the gui only change.

    Thank you,

    Vaibhav