File Exchange

image thumbnail

Path Following Using MATLAB and Simulink

version (156 KB) by Carlos Santacruz-Rosero
Simulink model of a self-parking vehicle


Updated 05 Dec 2017

View License

This entry contains the Simulink model for the "Path Planning and Navigation for Autonomous Robots" video. The demonstration walks through how to simulate a self-parking car with just three components: a path, a vehicle model, and a path following algorithm.  The vehicle model is implemented based on the kinematic equations of the bicycle model and the path following algorithm uses the built-in Pure Pursuit block from Robotics System Toolbox.

Comments and Ratings (22)

Hi Carlos, thank you very much for your work. Awesome job!
I'd like to know how and where I can change the vehicle path, in order to get different results.

Thank you very much!

Xiaolei Han

Fang LI

Got it works. Thanks!

Fang LI

Hi Carlos, I got the same 7 errors as Amin Ta.

Evan Lowe

Great Job Carlos. I'm wondering, are there explanations for how you got the simscape visualization working? Also where are the waypoints coming from in your system? The only .m file I see is for simscape setup. I'd like to know a little more about how I can reproduce something like this on my own. Thanks!

zhiying Wu


Oleg Musavi

Hello Mohammed: Please check the examples of Automated Driving System Toolbox. There are a couple of examples that showcase similar workflows.

Many thanks for sharing this Simulink model.
I have a question please, which is related to this work.
How to detect a free parking space from a web camera mounted on the front or side of a self driving car using Matlab or Simulink?

bob chan

bob chan

Hello, which book do you refer to?

Hello Cao. Thanks for your message. You can find a simple model in the Simulink Model that you can download with this submission. This uses basic Simulink blocks to implement the equations of motion. For more complex models of the vehicle dynamics please check the Vehicle Dynamics Blockset:

cao kaifa

hello, Carlos Santacruz-Rosero, Thank you for the good work, I want to ask where I find the kinematic equations of the bicycle model?

Is there anyway to get this to work with 2017a release? Thank you.

Thanks for the info, Amin. Issue resolved now.

amin ta

amin ta

need some file and definition to run
get 7 error when run Simulink!

Error evaluating parameter 'LookaheadDistance' in 'PathFollowingFV/Pure Pursuit'
Caused by:
Undefined variable "PP" or class "PP.LookaheadDist".


Added MAT files required to run the demo

MATLAB Release Compatibility
Created with R2017b
Compatible with any release
Platform Compatibility
Windows macOS Linux