This repository provides a small simulation environment based a four wheel model of a car and a Pacejka tire model. It also contains the implementation of a PID controller for constant longitudinal speed tracking and a Pure Pursuit controller for the lateral control of the car, using the steering angle.
The configuration file for the PID and Pure Pursuit controllers can be found at: src/CONTROLLER_PARAMS.py
-
PID Controller: A Proportional-Integral-Derivative (PID) controller uses three terms to adjust the control output:
- Proportional: Reacts to current error.
- Integral: Reacts to the accumulation of past errors.
- Derivative: Reacts to the rate of change of the error.
-
Pure Pursuit Controller: This controller follows a path by calculating the steering angle needed to reach a target point on the path ahead of the car, allowing for smoother turns and better trajectory tracking.
Before running the code, ensure you have the following:
-
Clone the Repository
git clone https://github.com/your-repo/Duckietown-Activity.git cd Duckietown-Activity
-
Install Requirements Install the necessary packages from requirements.txt. You may want to verify compatibility based on your environment:
pip install -r requirements.txt
-
Edit Controller Parameters Modify the controller parameters in:
src/CONTROLLER_PARAMS.py
-
Run the Simulation Execute the simulation to visualize the controller's performance:
python src/run.py