This repository contains Python code for controlling a PiBorg robot using OpenCV, a PID controller, and the ThunderBorg library. The robot is designed to follow a lead car at a set distance.
To use this code, you will need:
- Raspberry Pi with Raspbian OS
- PiBorg ThunderBorg motor controller
- Raspberry Pi camera module
- OpenCV library
- Python 3.x
To use the code, follow these steps:
- Clone the repository to your Raspberry Pi.
- Install the required libraries (OpenCV and ThunderBorg) using their respective installation instructions.
- Connect the Raspberry Pi camera module and the ThunderBorg motor controller to the Raspberry Pi.
- Connect the motor controller to the robot's motors.
- Modify the desired_distance variable in the pid_loop function to set the desired distance between the lead car and the robot.
- Run the pid_controller.py file with Python 3.x.
This repository is licensed with the Unlicense, which means you can use the code for any purpose without any restrictions. See the LICENSE file for more information.
This code was developed as the final project for a PHD Cyber Physical Systems class. It is intended to be used by the GenCyber camp during their summer camp, and may also be used for a personal publishable research paper.