This is an autonomous RC car designed to follow lanes on the ground and be able to stop when needed. We attached a Pi, DAC, Webcam, and Speed Encider to an RC car and were able to SSH into the pi to control it. We used code from:
User raja_961, “Autonomous Lane-Keeping Car Using Raspberry
Pi and OpenCV”. Instructables. URL: https://www.instructables.com/Autonomous-Lane-Keeping-Car-Using-Raspberry-Pi-and/
The Autonomous RC Car group: https://github.com/EthanDP/424-lane-keeping-project/blob/main/main.py
Resolution, Proportional gain, Derivative gainWe referenced raja_961’s code and resized our frames to 320 x 240. This resolution was the smallest possible dimensions it could be while still ensuring shape and color detection with OpenCV. For proportional gain and derivative gain, we started off with raja_961’s values kp = 0.4 and kd = kd*0.65 but found out that they were too large for us. We did trial and error to find the values that work for our course and car and ended with kp = 0.2 and kd = kp * 0.1.
Handling stopboxWe handled the stop box by taking a picture of the desired color paper and used an online HSV value converter. We used this to find the lower and higher bound of the HSV values we needed. Then, in the code, we had two checks. The primary one was to detect if this color was present on the screen and the second one was to check if this color was the majority part of the camera input to make sure we didn’t stop too far from the stop box.
Our vehicle
Comments
Please log in or sign up to comment.