Skip to content

A simple Python simulation showcasing basic obstacle avoidance behavior using the Pygame library. The robot moves across the screen, detects collisions with obstacles or boundaries, and dynamically changes direction — demonstrating core principles of motion, detection, and response in robotics.

Notifications You must be signed in to change notification settings

edsamsankey/obstacle-avoidance-sim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Obstacle Avoidance Simulator

A Python simulation that demonstrates a robot navigating a screen while avoiding obstacles. This project is a simple and fun example of game development using the Pygame library.

Features

  • A moving robot (represented as a blue circle).
  • Obstacles (red rectangles) that the robot avoids.
  • Random direction changes when the robot collides with obstacles or boundaries.
  • Smooth frame updates for a seamless experience.

Technologies Used

  • Python 3.10+
  • Pygame library

Prerequisites

  1. Python Installed: Make sure you have Python 3.10 or above installed.
  2. Pygame Library: Install Pygame using pip:
    pip install pygame
    

Expected Behavior The robot moves continuously across the screen. When it collides with obstacles or screen edges, it changes its direction randomly. Obstacles remain stationary.

Customization Options Change Robot Speed: Modify robot_speed to adjust the robot's speed. Add More Obstacles: Increase or decrease num_obstacles to change the number of obstacles. Resize the Screen: Adjust WIDTH and HEIGHT for a different screen size.

image

About

A simple Python simulation showcasing basic obstacle avoidance behavior using the Pygame library. The robot moves across the screen, detects collisions with obstacles or boundaries, and dynamically changes direction — demonstrating core principles of motion, detection, and response in robotics.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages