dctian / DeepPiCar

Deep Learning Autonomous Car based on Raspberry Pi, SunFounder PiCar-V Kit, TensorFlow, and Google's EdgeTPU Co-Processor
GNU General Public License v3.0
400 stars 271 forks source link

Picar wanders across lane lines #29

Open juneauwallace opened 6 months ago

juneauwallace commented 6 months ago

This has been a fun project to work on. Greatly appreciate the well written expanations and instructions. My question relates to the lane follower code. I have assembled the Picar-V and passed all of functional tests and calibrations. When I run the program (deep_pi_car.py), the car slowly veers to the left going outside the lane markers. Once outside the lane, it turns to the right and crosses back into the lane and veers again to the left going outside the lane. It then turns right, crossing the lane entirely before turning left again crossing outside the lane completely. Now it appears to be lost and stops. It appears to be searching for the lane but doesn't succeed and starts wandering (until it runs into the wall). It exhibits the same behavior with both a pi 3b and pi 4b (although the frames/second is quite a bit higher with the pi 4). I also noticed when plotting the lane lines and steering path, the lines never stabilize. The two lane lines crisscross each other and the red steering path is not consistent.

Can you recommend a good place to start troubleshooting the code. My initial thought is to examine the stabilize_steering_angle routine. Can you suggest places to add debug messages?

Thank you.