Implementing a Kinematic Vehicle Model for Autonomous Driving
Planning, Dynamics & Decision Systems DS practice problem on Onlearn.
Difficulty: medium.
Topics: Implementing a Kinematic Vehicle Model for Autonomous Driving, Bicycle Model Kinematics, Runge-Kutta Integration, Ackermann Steering Geometry, Euler-Lagrange Equations, Slip Angle Constraints, Classical Control Theory, Numerical Analysis, Vehicle Dynamics, State Estimation, Optimization Theory, Nonlinear Differential Equations, Discretization Methods, Coordinate Transformations, Trajectory Generation, Feedback Linearization.
Task: Kinematic Bicycle Model Simulation In autonomous driving and robotics, predicting how a vehicle will move given control inputs is fundamental for path planning, trajectory tracking, and simulation. The kinematic bicycle model is a widely used simplification that treats a four wheeled vehicle as a two wheeled bicycle, capturing the essential turning geometry. Your Task Implement the function kinematic vehicle model(initial state, controls, wheelbase, dt) that simulates a vehicle's trajectory over multiple time steps using Euler integration. State variables at each time step: x: x position in meters y: y position in meters theta: heading angle in radians v: velocity in meters per second Control inputs at each time step: acceleration: longitudinal acceleration (m/s^2) steering angle: front wheel steering angle (radians) Parameters: wheelbase: distance between front and rear axles (meters) dt: simulation time step (seconds) The function should return a numpy array of shape (N+1, 4) containing the full trajectory including the initial state, where N is the number of control steps. Each row contains [x, y, theta, v]. The vehicle's position and heading evolve based on its current velocity, heading, and the steering geometry of the bicycle model. Use forward Euler integration to propagate the state at each time step.