This project involves designing a speed control and path-following system for a simulated autonomous vehicle. The main objective is to track a predefined GPS path at a target speed of 5 mph, based on provided GPS data. The simulation is implemented in Python and includes vehicle dynamics models, sensor noise filtering, and path planning, along with real-time visualization.
- Vehicle Speed Control: Ensure the vehicle maintains the target speed using a PID controller.
- Path-Following Control: Develop and simulate a control system to follow the given GPS path accurately.
- Verification in Simulation: Implement and verify the control models within a Python-based simulation.
The system must:
- Track a path defined by GPS data with a target speed of 5 mph.
- Incorporate a dynamic vehicle model to account for factors like inertia and tire slip.
- Handle sensor noise using filtering techniques to maintain trajectory accuracy.
The project relies on GPS data contained in the file Loyd_nobel_nav_rosbag2_2024_11_11-11_24_51.csv. This file provides time-stamped coordinates, vehicle speed, and brake status. Additionally, latitude and longitude tables are used to convert GPS data into local X-Y coordinates.
- GPS Data: Includes
Latitude,Longitude,Speed[mps], andBrake_status. - Latitude and Longitude Conversion Tables:
1deg,1', and1''conversions for latitude and longitude, in various units (miles, feet, meters).
- Stanley Controller: Utilizes the Stanley method to adjust steering angle and minimize trajectory error.
- PID Controller with Anti-Windup: Controls the vehicle's speed, using proportional, integral, and derivative gains to maintain stability and prevent overshooting.
- Dynamic Bicycle Model: Models the vehicle's dynamics considering its speed, position, and orientation.
The Kalman Filter smooths GPS data by predicting and correcting the vehicle's position, reducing noise and enhancing path accuracy.
To facilitate path tracking, GPS coordinates are converted to local X-Y coordinates using interpolation functions based on latitude and longitude conversion tables.
The path is generated using cubic spline interpolation for smoother and more accurate path tracking.
To run this project, the following Python libraries are required:
numpymatplotlibpandasscipynumba
Install these packages using:
pip install numpy matplotlib pandas scipy numba- Place
latitude_distance_to_latitude.csv,longitude_distance_to_longitude.csv, andLoyd_nobel_nav_rosbag2_2024_11_11-11_24_51.csvin the same directory as the script. - Run the script:
python auto_driving_final_project_controller.py
- Animation Mode: If
show_animationis set toTrue, a live plot of the vehicle’s path tracking and speed profile will be displayed.
- Path Tracking Plot: Displays the GPS path with start and end markers, and the vehicle's trajectory as it follows the path.
- Speed Profile Plot: Plots the speed of the vehicle over time, showing its adherence to the target speed.
This project is licensed under the MIT License. See LICENSE for more details.