Bug on RangeAngleImage module c++

Announcements

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
RaffaeleMi
Level 1
Level 1
5 replies posted 5 sign-ins First like given

Hi everyone, I write a program in c++ using radar sdk 3.2.1 and I found a discrepanse between documentation and function. In particular the problem is in the function named ifx_rai_run_r (and ifx_rai_run_rc) in the params input that in the docs is in form numAntennas x chirps x samples but I found in the RangeAngleImage.c that in line 311 (ifx_cube_get_slice_r((ifx_Cube_R_t*)input, ant_array, &rawdata_view); // set view to the rx antenna for raw data matrix)
it gets slice and not row to get single antenna data, infact the function not working.
Please can it be corrected or give me an example how to use it.
Thanks in advance

0 Likes
1 Solution
hartmannmich
Employee
Employee
First like given 10 replies posted 10 sign-ins

I had a look at the function and indeed: The functions  ifx_rai_run_r and ifx_rai_run_cr currently expect the time-domain data (input) as a cube with dimensions num_chirps_per_frame (rows) x num_samples_per_frame (cols) x num_rx_antennas (slices). This is a bug as this behavior is different than described in the documentation.

The expected behavior is that the input cube has the order num_rx_antennas (rows) x num_chirps_per_frame (cols) x num_samples_per_chirp (slices). This is the same format used to return the time-domain data by ifx_avian_get_next_frame.

The fix is rather easy: For ifx_rai_run_r replace in the file RangeAngleImage in line 313

 

ifx_cube_get_slice_r((ifx_Cube_R_t*)input, ant_array, &rawdata_view); // set view to the rx antenna for raw data matrix)

 

by:

 

ifx_cube_get_row_r(input, ant_array, &rawdata_view); // set view to the rx antenna for raw data matrix)

 

The cast "(ifx_Cube_R_t*)" is not neccessary and can be removed. The more important change is to change ifx_cube_get_slice_r by ifx_cube_get_row_r which fixes the ordering.

Similarily, for ifx_rai_run_cr change the line 367 in RangeAngleImage.c

 

ifx_cube_get_slice_c((ifx_Cube_C_t*)input, ant_array, &rawdata_view); // set view to the rx antenna for raw data matrix

 

to

 

ifx_cube_get_row_c(input, ant_array, &rawdata_view); // set view to the rx antenna for raw data matrix

 

After that, re-build  (re-compile) the Radar SDK. You can follow the instructions given in the section "Building SDK from source code" of the Radar SDK documentation.

We will fix the bug with the next release. Thank you for reporting the bug!

We will also improve the documentation:

hartmannmich_0-1656517048929.png

Please let us know if you have additional questions.

View solution in original post

17 Replies
Deepa_V
Moderator
Moderator
Moderator
First comment on KBA 50 likes received 250 replies posted

Hi @RaffaeleMi , 

Please go through the working example for Range Angle map in python environment at C:\Infineon\Tools\Radar Development Kit\3.2.1.202205180921\application\RDK-TOOLS-SW\RDK-TOOLS-SW\SDK\apps\py\examples. Also, for more information regarding the API's do go through C:\Infineon\Tools\Radar Development Kit\3.2.1.202205180921\application\RDK-TOOLS-SW\RDK-TOOLS-SW\SDK\doc .

Best regards,

Deepa

0 Likes

Thank for your reply @Deepa_V @, but i can only use c++, no python

0 Likes
Deepa_V
Moderator
Moderator
Moderator
First comment on KBA 50 likes received 250 replies posted

Hi  @RaffaeleMi ,

There isn't an example code available in C++ so please take the python code as reference for your use. 

Best regards,

Deepa

 

0 Likes

@Deepa_V  yes, I have used it for configuration reference but I found an error in the function ifx_rai_run_r of c++ api, so it should be corrected or directly removed if anyone can use it...

In the original post i also segnalate the line with the error.

Is there any module to bug report?

0 Likes
Deepa_V
Moderator
Moderator
Moderator
First comment on KBA 50 likes received 250 replies posted

Hi @RaffaeleMi ,

We are looking into it from our side. Will soon get back to you. 

Best regards,

Deepa

0 Likes

@RaffaeleMi: I will have a look at it.

If I understand you correctly, you say that ifx_rai_run_r and ifx_rai_run_cr the documentation is incorrect. While the documentation claims that the dimensions of the input cube are in the order num_rx_antennas x num_chirps_per_frame x num_samples_per_frame, the function actually expects the input in the order num_chirps_per_frame x num_samples_per_frame x num_rx_antennas. Did I understand you correctly?

I had a very initial glimpse at the problem and it seems that you are right. We are currently analyzing the problem and working on a fix.

As a temporary workaround you could manually reorder the input cube (I didn't have the time to test this yet, so it might or might not work):

ifx_Cube_R_t* input_reorderd = ifx_cube_clone_r(input);
for (uint32_t r = 0; r < IFX_CUBE_ROWS(input); r++)
{
    for (uint32_t c = 0; c < IFX_CUBE_COLS(input); c++)
    {
        for (uint32_t s = 0; s < IFX_CUBE_SLICES(input); s++)
        {
            IFX_CUBE_AT(input_reordered, c,s,r) = IFX_CUBE_AT(input, r,c,s);
        }
    }
}

ifx_rai_run_r(rai, input_reordered, output);
ifx_cube_destroy_r(input_reordered);

As said, we are looking into the issue and will come back to you.

 

 

0 Likes

For other people who will read this message, the line "ifx_Cube_R_t* input_reorderd = ifx_cube_clone_r(input);" would be "ifx_Cube_R_t* input_reorderd = ifx_cube_create_r(input->cols, input->slices, input->rows);".

0 Likes
hartmannmich
Employee
Employee
First like given 10 replies posted 10 sign-ins

I had a look at the function and indeed: The functions  ifx_rai_run_r and ifx_rai_run_cr currently expect the time-domain data (input) as a cube with dimensions num_chirps_per_frame (rows) x num_samples_per_frame (cols) x num_rx_antennas (slices). This is a bug as this behavior is different than described in the documentation.

The expected behavior is that the input cube has the order num_rx_antennas (rows) x num_chirps_per_frame (cols) x num_samples_per_chirp (slices). This is the same format used to return the time-domain data by ifx_avian_get_next_frame.

The fix is rather easy: For ifx_rai_run_r replace in the file RangeAngleImage in line 313

 

ifx_cube_get_slice_r((ifx_Cube_R_t*)input, ant_array, &rawdata_view); // set view to the rx antenna for raw data matrix)

 

by:

 

ifx_cube_get_row_r(input, ant_array, &rawdata_view); // set view to the rx antenna for raw data matrix)

 

The cast "(ifx_Cube_R_t*)" is not neccessary and can be removed. The more important change is to change ifx_cube_get_slice_r by ifx_cube_get_row_r which fixes the ordering.

Similarily, for ifx_rai_run_cr change the line 367 in RangeAngleImage.c

 

ifx_cube_get_slice_c((ifx_Cube_C_t*)input, ant_array, &rawdata_view); // set view to the rx antenna for raw data matrix

 

to

 

ifx_cube_get_row_c(input, ant_array, &rawdata_view); // set view to the rx antenna for raw data matrix

 

After that, re-build  (re-compile) the Radar SDK. You can follow the instructions given in the section "Building SDK from source code" of the Radar SDK documentation.

We will fix the bug with the next release. Thank you for reporting the bug!

We will also improve the documentation:

hartmannmich_0-1656517048929.png

Please let us know if you have additional questions.

Also the line 338 "ifx_cube_get_slice_r(output, image, &rai_view);" must be changed in "ifx_cube_get_row_r(output, image, &rai_view);". Don't remember to change the same two line and the documentation for ifx_rai_run_rc().
For other people who will read this message (until a new release is published) the library is linked so it is not enough to replace this line but you have to recompile or copy the function into your program.

@hartmannmich Please correct your answer with this suggestion, so I can mark it as solution. Thank you a lot.

0 Likes

In ifx_rai_run_r, also the line 338 "ifx_cube_get_slice_r(output, image, &rai_view);" must be changed in "ifx_cube_get_row_r(output, image, &rai_view);", because the output is in form of image*sample*beams and not sample*beams*image.
Don't remember to change the same line and the documentation for ifx_rai_run_rc().
@hartmannmich Please correct your answer with this suggestion, so I can mark it as solution. Thanks

0 Likes

I have updated the reply. Two functions need to be adjusted as described in my answer.

0 Likes

In the last message I refer to another incorrect line. Please, look better...

0 Likes

It is sufficient to modify lines 313  and 367 and explained in my reply.

0 Likes

If you change only that line, it gives MATRIX_MISMATCH... so to use RAI I must change the other line that I wrote... I don't know why... Do you write an example of use in c++?

0 Likes

The Avian radar sensors like BGT60TR13C just give real-valued time-domain signal data. If you use our radar sensors, you should not even need the complex version of Angle Capon.

0 Likes

@hartmannmich  Sorry but I have notified by mail that your response is accepted by solution BUT if you don't modify the other line that I reported (line 338 "ifx_cube_get_slice_r(output, image, &rai_view);" must be changed in "ifx_cube_get_row_r(output, image, &rai_view);", because the output is in form of image*sample*beams and not sample*beams*image) the function NOT WORKING. Have you  check it?

0 Likes

Thank you for the reminder. The line will also be fixed in the next release.