Borrar filtros
Borrar filtros

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

48 visualizaciones (últimos 30 días)
Xuedong
Xuedong el 21 de Ag. de 2024 a las 19:03
Comentada: Xuedong el 22 de Ag. de 2024 a las 16:10
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 comentarios
Naga
Naga el 22 de Ag. de 2024 a las 1:40
Did you make any changes to the example model, or did you just run the same model?
Xuedong
Xuedong el 22 de Ag. de 2024 a las 12:45
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.

Iniciar sesión para comentar.

Respuesta aceptada

Jatin Singh
Jatin Singh el 22 de Ag. de 2024 a las 13:50
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 comentario
Xuedong
Xuedong el 22 de Ag. de 2024 a las 16:10
Thank you very much for your detailed and clear guidance. Now I can see the radar image by commenting out the close(fig) line.

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Productos


Versión

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by