Skip to content

sanjaybarla/self_driving_car_udacity

Repository files navigation

Self-Driving Car Simulation Controller

This project connects a trained neural network model with the Udacity Self-Driving Car Simulator to control a car autonomously based on real-time image data.

πŸ“¦ Project Structure

  • model/model.h5: Trained Keras model file.
  • drive.py: Main Python server that receives simulator images, predicts steering angles, and sends control commands back.

πŸš€ How to Run This Project

Follow these steps carefully:

1. Install Udacity Self-Driving Car Simulator

2. Clone this Repository

git clone https://github.com/sanjaybarla/self_driving_car_udacity.git
cd self_driving_car_udacity

3. Set Up Python Environment

Make sure you have Python 3.6 or higher.

4. Install Required Libraries

pip install -r requirements.txt

5. Run the Python Server

python server.py

The server will start listening on port 4567. You should see

connected

6. Start the Simulator

  • Open the Udacity Self-Driving Car Simulator.
  • Select "Autonomous Mode".
  • Click "Select".
  • The simulator will now send camera images to your server, and your server will respond with steering and throttle commands!

🧠 Notes

This project uses a trained deep learning model to predict steering angles based on preprocessed images. Throttle is adjusted dynamically based on the speed (simple formula: throttle = 1.0 - (speed / speed_limit)). Image preprocessing includes cropping, color space conversion (RGB β†’ YUV), Gaussian blur, resizing, and normalization.


πŸ“· Image Preprocessing

  • Incoming camera images are processed with:
  • Crop (remove sky and car hood)
  • Convert RGB to YUV color space
  • Apply Gaussian blur
  • Resize to (200x66) pixels
  • Normalize pixel values between 0 and 1

This matches the Nvidia end-to-end self-driving car model training approach.


πŸŽ‰ That's it! Happy Driving!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages