

The script loads certain constants needed by the Simulink model, such as vehicle parameters, controller parameters, the road scenario, and reference poses.

Opening the model also runs the helperLateralControlTutorialSetup script, which initializes data used by the model. The subsystem also models the environment by using a Scenario Reader block to read the roads and actors from the LateralControl.mat scenario file. Given the current pose of the vehicle, it determines the reference pose by searching for the closest point to the vehicle on the reference path.Ī Vehicle and Environment subsystem, which models the motion of the vehicle using a Vehicle Body 3DOF (Vehicle Dynamics Blockset) block. In this scenario, the vehicle:Ī HelperPathAnalyzer block, which provides the reference signal for the lateral controller. For detailed steps on adding roads, lanes, and vehicles, see Create Driving Scenario Interactively and Generate Synthetic Sensor Data. This scenario includes a single, three-lane road and the ego vehicle. The scenario was created using the Driving Scenario Designer app. You can set the configuration through the Vehicle model parameter in the block dialog box. In this configuration, the controller also requires the path curvature, the current yaw rate of the vehicle, and the current steering angle to compute the steering command. This more complicated, but more accurate, model allows the controller to handle realistic dynamics. The steering command is computed based on the reference pose, the current pose, and the velocity of the vehicle.ĭynamic bicycle model: The dynamic model includes inertia effects: tire slip and steering servo actuation. This configuration is mainly suitable for low-speed environments, where inertial effects are minimal.

Kinematic bicycle model: The kinematic model assumes that the vehicle has negligible inertia.
