SunFounder picar-x
4.4 Obstacle Avoidance
In this project, PiCar-X will detect obstacles in front of it while moving forward, and when the obstacles are too close,
it will change the direction of moving forward.
Run the Code
cd /home/pi/picar-x/example
sudo python3 avoiding_obstacles.py
After running the code, PiCar-X will walk forward.
If it detects that the distance of the obstacle ahead is less than 25cm, it will turn left.
4.4. Obstacle Avoidance 55