Plot trajectory generated by the Driving Scenario Designer

15 visualizaciones (últimos 30 días)
Rajini
Rajini el 16 de Dic. de 2022
Respondida: Kothuri el 15 de Nov. de 2024 a las 16:07
Hello everyone,
I can set the trajectory of the car in the Driving Scenario Designer but how can I plot the simulation of scenario changing with time in a 2D graph? For example, the car is running on the planned trajectory every sampling time.
Thank you very much.

Respuestas (1)

Kothuri
Kothuri el 15 de Nov. de 2024 a las 16:07
Hi Rajini,
To plot the simulation of a vehicle's trajectory over time in a 2D graph using Simulink and the Driving Scenario Designer, you can follow the below steps:
  • In your Simulink model, add a block to log the vehicle's position over time. You can use a “To Workspace” block to store the vehicle's position data during the simulation.
  • Connect the Position output of the vehicle block (or a similar signal) to the “To Workspace” block. Configure the “To Workspace” block to save the data in a variable, e.g., vehiclePosition.
  • Run the simulation. The vehicle's position data will be logged in the workspace variable “vehiclePosition”.
  • After the simulation completes, use MATLAB to plot the trajectory.
You can refer the below links for more info on “To Workspace” block and an example on ”Visualize Simulation Data on XY Plot”

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by