Skip to content

johnklucinec/bevy_sim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bevy Simulator

Rust Bevy Python OpenCV YOLOv8 Status

A self-driving car simulation project that combines game development tools with computer vision and AI techniques. Built with Bevy Engine and enhanced with Python-based image recognition.

Table of Contents

Overview

Bevy Simulator is an engineering simulation project that demonstrates self-driving capabilities using game development tools. The project creates a virtual environment where a vehicle can be controlled manually or autonomously through computer vision techniques.

The simulation uses the Bevy game engine to create the physics and environment, while Python scripts handle image recognition through OpenCV and YOLOv8. The system detects road edges and uses PID controllers to keep the vehicle on track.

Features

  • Interactive Simulation: Drive a vehicle manually using keyboard controls
  • Environmental Generation: Procedurally generated roads and obstacles
  • Computer Vision Integration: Real-time image processing with OpenCV
  • Self-Driving Capabilities: PID-based autonomous driving using edge detection
  • Dual Window System: Main game window and secondary vision processing window
  • Interprocess Communication: Bidirectional data exchange between Rust and Python

Technologies

Game Engine & Physics

  • Bevy Engine: Modern data-driven game engine written in Rust
  • Rust: Systems programming language that guarantees memory safety

Computer Vision & AI

  • Python: Scripting language for computer vision implementation
  • OpenCV: Open source computer vision and machine learning library
  • YOLOv8: Real-time object detection system

Communication

  • Interprocess Communication: Custom protocol for Rust-Python communication

Getting Started

Installation

  1. Clone the Repository
git clone https://github.com/username/bevy-simulator.git
cd bevy-simulator
  1. Rust Setup
    • Ensure Rust and Cargo are installed on your system
    • Cargo will automatically handle all Bevy dependencies
  2. Python Setup
    • Navigate to the Python module directory:
cd src/game/python
  1. Python Setup Continued
    • Follow the instructions in the Python README to set up the AI components

Usage

Manual Control

  • Arrow Keys: Drive the vehicle (up/down for acceleration/braking, left/right for steering)
  • G Key: Change gears

Autonomous Mode

  • Tab Key: Toggle the secondary window for image recognition visualization (automatically starts autonomous driving)

Project Structure

  • 📁 bevy_sim
    • 📁 ai
    • 📁 assets
    • 📁 src
      • 📁 game
        • 📁 biome
        • 📁 car
        • 📁 camera
        • 📁 python
        • 📁 ui
      • 📁 main_menu
    • 📄 main.rs
    • 📄 system.rs

📌 Note: Folders with 🔗 links contain their own README files with more detailed documentation

Contributors

John Klucinec Brant Cass Ramiro Covarrubias Alex Collins
John Klucinec
Game States • UI • IPC • Image Recognition
Brant Cass
World Generation • PID Controls
Ramiro Covarrubias
Car Physics • PID Controls
Alex Collins
Initial Planning • Documentation

This project was created as part of the CS 462 course, Spring 2025

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •