Driving scenario designer path reference

5 views (last 30 days)
Hi all,
Can anyone guide me through exporting and using the waypoints (X,Y) and yaw angle information to simulink (using simin) ) for my vehicle to follow the prescribed reference trajectory. I already have my X, Y and yaw angle informations but i need to give it to my simulink controller as a timeseries reference trrajectory. How can I do that?
I appreaciate your cooperation

Answers (1)

Anjaneyulu Bairi
Anjaneyulu Bairi on 7 Jan 2025
Hi,
To export the data from created scenario ,you can follow below steps:
1) Export the scenario to MATLAB function:
  • Click on "Export" button on the top-right and click "MATLAB Function"
  • It will open the MATLAB script related to created scenario.
2) Save the Data:
  • At the end of the script , write the below code
save("data.mat")
  • This will save the all variables in the script to MAT file.
3) Access the variables from MAT file:
  • Load the MAT file.
  • Access the "roadCenters" variable first column which gives 'x' and second column which gives 'y'
x = roadCenters(:, 1);
y = roadCenters(:, 2);
Now, you can pass these variables to "simin" function.
Hope this helps!

Community Treasure Hunt

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

Start Hunting!