Self-Driven AI Car is a project that simulates an autonomous car using a custom environment built with Gymnasium. The car is trained using the PPO algorithm from the stable_baselines3 library, providing an interactive and customizable experience for AI enthusiasts.
Project written by creating custom Gymnasium environment.
- Clone this project.
- Install the environment using
build.bat
(it fixes some path issues that I didn't have time to resolve manually). - Install dependencies:
pip install pygame gymnasium stable_baselines3
- Edit the
run.py
file according to your needs. - Navigate to the Patro_Car directory and run:
python run.py
- game_fps (default=300): Controls the game clock speed if
render_mode="human"
is set. - rotation_amount (default=6): Defines how much the car rotates.
- max_speed (default=4): Sets the maximum speed of the car.
- acceleration_amount (default=0.1): Determines the car's acceleration rate.
AI_Car.mp4
Great TUTORIAL about this topic:
Car trained by PPO algorithm from stable_baselines3.