This project uses a PID controller to balance a ball on a 2D plane. The ball's position is tracked using a camera and the ball's movement is controlled using two servos.
main.py
: The main script that runs the ball tracking program.controller.py
: Contains thePIDController
andServoController
classes for controlling the ball's movement.tracker.py
: Contains theBallTracker
class for tracking the ball's position using a camera.util.py
: Contains utility functions used throughout the project.requirements.txt
: Lists the Python dependencies required for this project.
- Install the required Python dependencies:
sudo apt install python3-pigpio
pip install -r requirements.txt
- Run the main script:
sudo pigpiod
python main.py
MIT