Python implementation of an automatic parallel parking system in a virtual environment, including path planning, path tracking, and parallel parking

Overview

Automatic Parallel Parking: Path Planning, Path Tracking & Control

This repository contains a python implementation of an automatic parallel parking system in a virtual environment that includes path planning, path tracking, and parallel parking. The agent navigates its route through the environment and is directed to the assigned park location by the MPC controller. You can find the article on Towards Data Science.

Envroinment

The first step to develop an auto park system is to design and develop an environment capable of giving visual render using OpenCV library. The environment is implemented in environment.py as a class and receives obstacles at the beginning env = Environment(obs). The agent can be placed using env.render(x,y,angle). A sample of the environment is displayed below. You can choose the parking spot from 1 to 24.

developed environment

Path Planning

A* Algorithm

The agent will find a path from start to its goal using A*. This implementation of A* from PythonRobotics considers parameters like obstacles and robot radius.

Interpolating Path With B-spline

After finding a path in a discrete 100*100 space, the path is smoothed and scaled to 1000*1000 space of environment using b-spline. The result is a set of points to guide our agent!

Path Tracking

The kinematic model of the car is:

x' = v . cos(ψ)
y' = v . sin(ψ)
v' = a
ψ' = v . tan(δ)/L

a: acceleration, δ: steering angle, ψ: yaw angle, L: wheelbase, x: x-position, y: y-position, v: velocity

The state vector is:

z=[x,y,v,ψ]

x: x-position, y: y-position, v: velocity, ψ: yaw angle

The input vector is:

u=[a,δ]

a: acceleration, δ: steering angle

Control

The MPC controller controls vehicle speed and steering based on the model and the car is directed through the path. There is an option for using the linearized model for MPC. In this case MPC linearizes the kinematic model around the operating point and then does the optimization.

Parallel Parking

This part consists of 4 rules that the agent must choose according to parking position. At first, the agent will find a path to park position then it will compute the arriving angle. Based on the arriving angle, the agent chooses a coordinate as ensure1. After that, the parking path is planned from ensure1 to ensure2 using 2 circle equations as mentioned below. MPC controls the agent and car parks in ensure2 coordinate.

automatic_parking_process

Inference

Run the code using this command:

$ python main_autopark.py --x_start 0 --y_start 90 --psi_start 0 --parking 7

About Us

We as Team Pandas won 1st place in the National Rahneshan competition 2020-2021 for autonomous vehicles. This contest has been one of the most competitive and challenging contests in the Rahneshan tournaments with more than 15 teams competing from top universities in Iran.

Contact

Feel free to contact us via email or connect with us on linkedin.

You might also like...
This is a practice on Airflow, which is building virtual env, installing Airflow and constructing data pipeline (DAGs)

airflow-test This is a practice on Airflow, which is Builing virtualbox env and setting Airflow on that env Installing Airflow using python virtual en

🤖🤖 Jarvis is an virtual assistant which can some tasks easy for you like surfing on web opening an app and much more... 🤖🤖

Jarvis 🤖 🤖 Jarvis is an virtual assistant which can some tasks easy for you like surfing on web opening an app and much more... 🤖 🤖 Developer : su

Find virtual hosts (vhosts) from IP addresses and hostnames

Features Enumerate vhosts from a list of IP addresses and domain names. Virtual Hosts are enumerated using the following process: Supplied domains are

A modern python module including many useful features that make discord bot programming extremely easy.

discord-super-utils Documentation Secondary Documentation A modern python module including many useful features that make discord bot programming extr

This is a vscode extension with a Virtual Assistant that you can play with when you are bored or you need help..

VS Code Virtual Assistant This is a vscode extension with a Virtual Assistant that you can play with when you are bored or you need help. Its currentl

TeamFleming is a multicultural group of 20 young bioinformatics enthusiasts participating in the 2021 HackBio Virtual Summer Internship
TeamFleming is a multicultural group of 20 young bioinformatics enthusiasts participating in the 2021 HackBio Virtual Summer Internship

💻 Welcome to Team Fleming's Repo! #TeamFleming is a multicultural group of 20 young bioinformatics enthusiasts participating in the 2021 HackBio Virt

Automatically deletes Capital One Eno virtual cards for when you've made a couple too many.

eno-delete Automatically deletes Capital One Eno virtual cards for when you've made a couple too many. Warning: Program will delete ALL virtual cards

 JPMC Virtual Experience
JPMC Virtual Experience

This repository contains the submitted patch files along with raw files of the various tasks assigned by JPMorgan Chase & Co. through its Software Engineering Virtual Experience Program on Forage (formerly Inside Shepra).

A webdav demo using a virtual filesystem that serves a random status of whether a cat in a box is dead or alive.

A webdav demo using a virtual filesystem that serves a random status of whether a cat in a box is dead or alive.

Comments
  • Question about vehicle length

    Question about vehicle length

    Thank you for your work. I have question about vehicle length. length=4 in https://github.com/Pandas-Team/Automatic-Parking/blob/master/CAR%20kinematic%20model/main_autopark.py#L53. But is it better to be length=5 because wheelbase is 50 in 1000 coordinates (https://github.com/Pandas-Team/Automatic-Parking/blob/master/CAR%20kinematic%20model/environment.py#L12) and 5 in 100 coordinates

    opened by kosuke55 4
  • README

    README

    Some typo in README.

    1/ kinematic.

    Currently, written:

    The kinematic model of the car is:
    x = vcos(ϕ)
    y = vsin(ϕ)
    v = a
    ϕ = vtan(δ)/L
    

    1.1/ Missing derivative symbol '. Should be:

    The kinematic model of the car is:
    x' = v . cos(ϕ)
    y' = v . sin(ϕ)
    v' = a
    ϕ' = v . tan(δ)/L
    

    1.2/ Missing: a: acceleration, δ: steering angle, ϕ: yaw angle, L: wheelbase, x: x-position, y: y-position, v: velocity 1.3/ v was stuck to cos, sin, tan.

    2/ The state vector.

    The symbol φ should be ϕ

    3/ The input vector

    There is a typo a: accellation, δ: steering angle => acceleration :)

    opened by Lecrapouille 4
  • problem about car control

    problem about car control

    Hi,

    Please see the attached video, I don't change any thing, but the control looks very wired, could someone tell me what the problem is? Thanks.

    https://user-images.githubusercontent.com/9857420/169484973-ff404723-defd-4bae-a209-db1be99bea64.mp4

    opened by Phymin 1
Releases(v1.0)
An improved version of the common ˙pacman -S˙

BetterPacmanLook An improved version of the common pacman -S. Installation I know that this is probably one of the worst solutions and i will be worki

1 Nov 06, 2021
Team collaborative evaluation tracker.

Team collaborative evaluation tracker.

2 Dec 19, 2021
Vector tile server for the Wildfire Predictive Services Unit

wps-tileserver Vector tile server for the Wildfire Predictive Services Unit Overview The intention of this project is to: provide tools to easily spin

Province of British Columbia 6 Dec 20, 2022
Turn crypto miner on/off depending on powerwall charge level

Mining Crypto with Tesla Solar and Powerwalls This script turns a crypto miner on and off when the Tesla Powerwall level drops/rises above a certain t

Matt 1 Nov 09, 2021
Modern API wrapper for Genshin Impact built on asyncio and pydantic.

genshin.py Modern API wrapper for Genshin Impact built on asyncio and pydantic.

sadru 212 Jan 06, 2023
Simple Crud Python vs MySQL

Simple Crud Python vs MySQL The idea came when I was studying MySQ... A desire to create a python program that can give access to a "localhost" databa

Lucas 1 Jan 21, 2022
A powerful and user-friendly binary analysis platform!

angr angr is a platform-agnostic binary analysis framework. It is brought to you by the Computer Security Lab at UC Santa Barbara, SEFCOM at Arizona S

6.3k Jan 02, 2023
An easy-to-learn, dynamic, interpreted, procedural programming language

Gen Programming Language WARNING!! THIS LANGUAGE IS IN DEVELOPMENT. ANYTHING CAN CHANGE AT ANY MOMENT. Gen is a dynamic, interpreted, procedural progr

Gen Programming Language 7 Oct 17, 2022
This Python script can enumerate all URLs present in robots.txt files, and test whether they can be accessed or not.

Robots.txt tester With this script, you can enumerate all URLs present in robots.txt files, and test whether you can access them or not. Setup Clone t

Podalirius 32 Oct 10, 2022
Companion Web site for Fluent Python, Second Edition

Fluent Python, the site Source code and content for fluentpython.com. The site complements Fluent Python, Second Edition with extra content that did n

Fluent Python 49 Dec 08, 2022
GNU/Linux'u yeni kurulumu bitirmiş olarak açtığınızda sizi karşılayacak bir uygulama.

Hoş Geldiniz GNU/Linux'u yeni kurulumu bitirmiş olarak açtığınızda sizi karşılayacak bir uygulama.

Alperen İsa 96 Oct 30, 2022
The best free and open-source automated time tracker. Cross-platform, extensible, privacy-focused.

Records what you do so that you can know how you've spent your time. All in a secure way where you control the data. Website — Forum — Documentation —

ActivityWatch 7.8k Jan 09, 2023
a url shortener with fastapi and tortoise-orm

fastapi-tortoise-orm-url-shortener a url shortener with fastapi and tortoise-orm

19 Aug 12, 2022
A companion web application to connect stash to deovr

stash-vr-companion This is a companion web application to connect stash to deovr. Stash is a self hosted web application to manage your porn collectio

19 Sep 29, 2022
A fast python implementation of DTU MVS 2014 evaluation

DTUeval-python A python implementation of DTU MVS 2014 evaluation. It only takes 1min for each mesh evaluation. And the gap between the two implementa

82 Dec 27, 2022
Contains the code of my learning of Python OOP.

OOP Python This repository contains the code of my learning of Python OOP. All the code: is following PEP 8 ✅ has proper concept illustrations and com

Samyak Jain 2 Jan 15, 2022
PIP VA TASHQI KUTUBXONALAR

39-dars PIP VA TASHQI KUTUBXONALAR KIRISH Avvalgi darsimizda Python bilan birga o'rnatluvchi, standart kutubxona va undagi ba'zi foydali modullar bila

Sayfiddin 3 Nov 25, 2021
Hashcrack: Hash Bruteforse tool using python

HashCrack Hash Bruteforse tool Usage hashcrack.py -n 6 -c lower -l 5 -a md5 -t 3

Lev 1 May 04, 2022
Job Guy Backend

جاب‌گای چیست؟ اونجا وضعیت چطوریه؟ یه سوال به همین کلیت و ابهام معمولا وقتی برای یه شرکت رزومه می‌فرستیم این سوال کلی و بزرگ برای همه پیش میاد.اونجا وض

Jobguy.work 217 Dec 25, 2022
Retrieve bank transactions and categorize for budgeting use

Budgeting After trying out some budgeting software, I decided to make my own. selenium_scraper Using the selenium package, this script runs an instanc

Marc 1 Nov 10, 2021