How to display Vehicle name and it's distance from ego vehicle with birdsEyePlot() function.
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
At present i am able to simulate road conditions and radar detections . i used drivingRadarDataGenerator() and createDrivingScenario objects for simulations.
using
bep = birdsEyePlot('XLim',[0 60],'YLim',[-75 75]); to plot the detections and road conditions.
using below function for detectons..
clusterDetPlotter = detectionPlotter(bep, ...
'DisplayName','Clustered detections', ...
'MarkerEdgeColor','red', ...
'MarkerFaceColor','red');
using below function to plot the detection using birdsEyePlot() function.
plotDetection(clusterDetPlotter,detPos);
With below code i was able to measure the target vehicle distance from the ego vehicle but not able to display that measurement on bird's eye plot on the screen.
for c=1:numDets
sqrX = targets(c).Position(1) *targets(c).Position(1);
sqrY = targets(c).Position(2) *targets(c).Position(2);
distance_target(c)= sqrt(sqrX+sqrY);
end
How can i display distance of target vehicle wrt to ego vehicle on birds eye plot??
0 Kommentare
Antworten (1)
Raghava S N
am 9 Apr. 2025
The distances of the targets in the "distance_target" vector can be converted to strings and passed as labels to the "plotDetection" function. To convert the distances captured in the "distance_target" vector, you may use the function "num2str" in an "arrayfun" function to apply it to all the elements of "distance_target"-
labels = arrayfun(@num2str, distance_target,'UniformOutput', false);
After this, call "plotDetection" to plot the targets with the distances as the labels-
plotDetection(clusterDetPlotter,detPos,labels);
For more details about labels in the "plotDetection" function, you may refer to this link - https://www.mathworks.com/help/radar/ref/theaterplot.plotdetection.html#:~:text=10%2C%20%2D4%2C%201%5D%3B-,labels,-%3D%20%7B%27R1%27
For information about "num2str" and "arrayfun", you may refer to these links-
Hope that helps!
0 Kommentare
Siehe auch
Kategorien
Mehr zu Programmatic Scenario Authoring finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!