%% Generate INS Measurements from Driving Scenario in Simulink
% Generate measurements from an INS sensor that is mounted to a vehicle in a driving scenario. Visualize the position, velocity and acceleration profile of the vehicle using those sensor measurements in comparison with the ground truth values from the scenario.
%
%% Inspect Model
% Open the Simulink model that reads ground truth measurements from a driving scenario using the Scenario Reader block and generates measurements using the INS block. The Ego Vehicle State port is enabled in the Scenario Reader block to obtain the ground truth measurements, which are then fed to the INS block. For more information about creating interactive driving scenarios with INS sensor using Driving Scenario Designer app and exporting them to Simulink models, refer to Generate INS Sensor Measurements from Interactive Driving Scenario.

open_system('ScenarioINSExampleSimulinkModel');

%
%% Simulate the model and visualize measurements
% Simulate the model. Note that the ground truth and sensor measurements are set to be logged during the simulation.

sim('ScenarioINSExampleSimulinkModel');

% Open Simulation Data Inspector to visualize the position, velocity and acceleration profile of the vehicle based on the INS sensor measurements, in comparison with ground truth data obtained from the driving scenario. From the list of logged signals, select the signals corresponding to the measurements that you wish to compare and visualize.

Simulink.sdi.view

%
% Copyright 2020 The MathWorks, Inc.