“chasePlot” do't show ego vhicle?

조회 수: 3(최근 30일)
cui 2022년 7월 18일
편집: Adam Danz 2022년 7월 19일
why the following code did not show egovhicle? I try to set chasePlot propertites ViewLocation to larger than default,but it still can't show egovhicle? how can i fixt it?(run in R2022a)
scenario = drivingScenario("SampleTime",0.01,"StopTime",3);
roadNetwork(scenario,"OpenStreetMap","my_openstreetmap_export.xml");% openstreetmap xml file see attachment
egovhicle = vehicle(scenario,ClassID=1);
egopath = [-133,-388,0;-98,-266,0];
egospeed = 30;
  댓글 수: 3
Adam Danz
Adam Danz 2022년 7월 19일

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

채택된 답변

Adam Danz
Adam Danz 2022년 7월 19일
편집: Adam Danz 2022년 7월 19일
chasePlot is outside my area of expertise but I did some digging found that if you change the ViewLocation of the scene then your vehicle comes into view.
The default ViewLocation is behind the actor's center at 2.5x the length of the actor. Your vehicle length is 4.7 but for whatever reason, the viewLocation needs to be back even further. This value worked.
chasePlot(egovhicle,'ViewLocation', [-32,0])
This may indicate that there's something not right with your scene or vehicle properties or that there is a bug. If you think there's a bug, please contact tech support and supply your code and data file. Contact Us - MATLAB & Simulink
It may be helpful to trouble shoot by plotting the scene with a top-down view
% Look at a bird's eye view to see where the vehicle is
% It's a large scene which makes the vehicle small, zoom in to the vehicle
xlim([-190 -90])
ylim([-440, -350])

추가 답변(0개)

Community Treasure Hunt

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

Start Hunting!

Translated by