The radar auto driving example could not get the result I expected

조회 수: 1 (최근 30일)
Xuedong
Xuedong 2024년 8월 21일
댓글: Xuedong 2024년 8월 22일
Hi, experts,
I am using R2024a and trying to run the example of AutomatedDrivingRadarSimulationExample by running the two commands below in the Command Window of matlab:
>> openExample('driving_radar/AutomatedDrivingRadarSimulationExample')
>> AutomatedDrivingRadarSimulationExample
After running the example, I observed a plot (see SNRplot.png attached), but could not see the radar image (see RadarImage.png attached) which I expected. Any expert knows if I missed anything? How should I do (Do I need to modify matlab script in the example), in order to see the radar image (RadarImage.png attached)?
Running the attached matlab code got the same result: you can see a SNR plot, but not the radar images.
Many thanks!
  댓글 수: 2
Naga
Naga 2024년 8월 22일
Did you make any changes to the example model, or did you just run the same model?
Xuedong
Xuedong 2024년 8월 22일
Hi, Naga,
Thank you for your help. Now I can run the example.
I ran the example in the following 2 different ways, and got the same result:
1.In the matlab Command Window, I ran the example by issuing the following 2 commands:
>> openExample('driving_radar/AutomatedDrivingRadarSimulationExample')
>> AutomatedDrivingRadarSimulationExample
2.I copied all matlab code pieces from the example in the following link into the file Radar_image.m (see attached in my original question message).
In the Radar_image.m file, I only added the following line at the beginning of the file to declare the path of the example so that the matlab can find the helper funtions needed for the example.
addpath('C:\Users\HP\Documents\MATLAB\Examples\R2024a\driving_radar\AutomatedDrivingRadarSimulationExample\')
Then I ran Radar_image.m.
I observed the same result, no matter which way I ran the example:
Only the SNR plot is shown on my PC. No radar images are shown on my PC, though I expected that radar images are shown on my PC.

댓글을 달려면 로그인하십시오.

채택된 답변

Jatin
Jatin 2024년 8월 22일
You are correct that two figures are generated as part of the example, but on running the model you can only see the SNR plot and not the Radar Image.
This happens because the code is intended to run that way.
If you take a look at the “helperAutoDrivingRadarSigProc.mfile and scroll down to the definition of function “publishSnapshot” shown in the image below.
As suggested by the comments, the function intentionally closes the figure after using the snapnow command which takes the snapshot of the image for inclusion in the live script output.
As a workaround, if you want both figures to appear in separate figure windows, kindly go on and comment the line where function “close” is called.
Saving the function and running the script again will give you the desired results.
  댓글 수: 1
Xuedong
Xuedong 2024년 8월 22일
Thank you very much for your detailed and clear guidance. Now I can see the radar image by commenting out the close(fig) line.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Detection에 대해 자세히 알아보기

제품


릴리스

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by