how to generate a reference signal from the Driving Scenario Designer App?

9 次查看(过去 30 天)
Hello,I am trying to generate a referene signal from the Driving Scenario Designer app to build mpc controller , I want to get the yaw angle as a vector, everytime I export the scenario as a matlab function, I get the yaw angle only as a (1X1) element .....thanks in advance

回答(1 个)

Divija Aleti
Divija Aleti 2020-11-30
Hello,
Once you are done building your scenario, place a sensor on your Actor, change the 'Update Interval (ms)' as required and run the scenario. Then click 'Export -> Export Sensor Data' . In the dialogue box that appears, give a variable name to which you want to save the data and click OK. The data gets saved to the MATLAB base workspace. The yaw angles can be accessed as a vector by using a for loop.
For example, after 'Export Sensor Data' is clicked, I saved the data as 'sensor_data' as follows:
sensor_data:
Now to get the yaw angles as a vector, a for loop can be written as:
yaw=zeros(1,6);
for i=1:6
yaw(i)=sensor_data(i).ActorPoses.Yaw;
end
Output:
yaw =
-39.3675 -38.8738 -10.8638 32.5091 -6.1386 -36.1907
  1 个评论
Mahmoud Shetwi
Mahmoud Shetwi 2023-10-12
Hello
Have you come up with any results for the scenarios of how to take the position and Yaw angel from driving?
Please respond, Muhammad

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Develop Apps Using App Designer 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by