Memuat
Memuat
Watch every step above performed live, with English narration.
0 plays
Class book
Page 1 / 7
Cover: Class Autonomous Car MPC Path Tracking #1: Vehicle Bicycle Kinematic Model
Click a page or use ◀ ▶ to turn · swipe on mobile · to enlarge
Want to go deeper?
Join one of our courses or ask us directly on WhatsApp.
Picked from the software, topic, and level of “Class Autonomous Car MPC Path Tracking #1: Vehicle Bicycle Kinematic Model”.
Other ways we can help with Python.
Learn with a mentor
Scheduled Simulation & Engineering courses with live guidance and a certificate.

Course/Training Ansys ~ Heat Transfer and Heat Flux Analysis
★ 5.0 (10)

Course/Training MATLAB — MATLAB App Design: The Ultimate Guide to MATLAB Apps
★ 5.0 (10)

Course/Training Ansys — Airflow Simulation of a Car Radiator with ANSYS
★ 5.0 (9)
Have it built for you
No time to learn Python? Our team can do the project for you.

Matlab Development Service — Complete Neural Signal Processing and Analysis Zero to Hero
★ 5.0 (59)

Ansys Maxwell Development Service
★ 5.0 (50)

Petrel Development Service
★ 5.0 (14)
Get notified about new Python classes
At most one email a week. Unfollow anytime with one click.
The full narration of this video. The current sentence is highlighted while the video plays; click any sentence to jump there.
This is the final result, the vehicle motion model we wrote ourselves with Python, and it's proven to be accurate, with the radius block exactly the same as the L formula divided by the steering angle, up to 8 decimal places. This model becomes the foundation for the entire series. Let's start. Hello, welcome to the research tutorial series, autonomous vehicle control for path tracking based on model predictive control. Path tracking is the task of making the car follow a path as closely as possible, the core of every driverless car. In this 6-episode series, we build everything from scratch. Vehicle model, reference path, Pure Pursuit and Stanley controllers, MPC formulation, implementation with CVXPY, up to testing on a winding circuit. In the first episode, we model the vehicle. We open the terminal through the Terminal menu, New Terminal, then install Nampai, Skippy, CVXPY, and Matplotlib.
CVXPY will be used in episode 5 to solve the MPC optimization, while the vehicle model is written by us.
Create a file named vehicle.py The Bicycle model combines the two front wheels into one wheel and the two rear wheels into one wheel, like a bicycle. Its parameters are wheelbase 2.7 meters, time step 0.1 seconds, maximum steering angle 30 degrees, maximum acceleration 3 meters per second squared, and steering rate 30 degrees per second. The vehicle state has four variables: X and Y position of the rear axle, facing direction SI, and velocity V, with inputs of acceleration A and steering angle delta. The rate of change of direction is equal to V divided by L multiplied by the tangent of delta.
The constraint function keeps the inputs within physical limits, since the steering wheel cannot be turned more than 30 degrees. The step function integrates the model with Runge-Kutta fourth order, and the velocity is kept between 0 and 20 meters per second. The angle normalization function wraps the angle between minus pi and pi.
Create a file named test_underscore_vehicle.py and run it. With constant steering, the car should rotate on a circle with radius L divided by the tangent of delta. For a 5-degree steering angle, the theory is 30.86 meters and the simulation is exactly 30.86 meters. 10 degrees 15.31 meters, 20 degrees 7.42 meters, all match. A 40-degree steering angle is limited to 30 degrees, so the minimum turning radius is 4.68 meters. An acceleration of 2 meters per second squared for 5 seconds results in a velocity of 10 meters per second and an exact distance of 25 meters.
Let's look at the graph. The larger the steering angle, the smaller the turning circle, and a 40-degree request overlaps with a 30-degree circle because it is limited. The graph on the right shows an important aspect of control. With the same steering angle, the lateral velocity increases proportionally to the speed. Therefore, at high speeds, even a small steering error has a significant impact.
Done. We have built a bicycle model of the vehicle with steering limits, acceleration, and integration of curvature, then validated it using the turning radius formula. In the next episode, we will create a reference path and run a vehicle simulation. Currently working on a thesis, dissertation, or research in the field of autonomous vehicles and control systems? Cerdas Inovasi Digital helps implement vehicle control systems, from bicycle models, reference paths, pure pursuit, and Stanley, up to model predictive control with CVXPy, as well as offering Python programming courses for electrical and mechatronic engineering. Want to master the entire series, from vehicle models to circuit testing with various speeds? All 6 episodes, complete with PDF step-by-step guides and source code, are available to premium tutorial subscribers. Subscribe starting at Rp69.000 per month, save 28% with the 12-month package, or pay once Rp999.000 for lifetime access. Want just one class? Buy a single class with lifetime access. Subscribe now at the premium page cerdasinovasidigital.com. Contact us via WhatsApp, or visit cerdasinovasidigital.com. Thank you for watching, see you in the next episode.
Type a question or keyword; we find the part of this episode that explains it and jump the video there.
Notes are saved with the current video time and are only visible to you.
Stuck on a step? Ask here; the instructor and other learners can answer.
No questions yet.

Cerdas Inovasi Digital Team
Software developers, BIM & 3D engineers, and AI practitioners
We build software, BIM models, games and AI automations for clients every day, and turn that hands-on work into step-by-step classes: every step is shown on screen and comes with a PDF guide you can keep.
See our clients →