how to drive a four wheel robot to make straight moving ?

Hello everyone.
I would like to know from you an algorithm in AI that makes a maze solving robot ( Wall Follower ) move in a straight line ( 80%-90% accuracy ), I tried google but I didn't find what I want!
what I have for my setup as follows:

  1. four-wheel robot
  2. 4x Ultrasonic HC-SR04
  3. the mpu6050 sensor that able to measure the angle if the robot turn Left or Right.
  4. Arduino UNO.

the below image is the four-wheel kit that I have.

I am open to any suggestion and any help will be appreciated.

I am not surprised that you cannot find what you want. AI creates it's own algorithms by learning from it's mistakes.

Not something an Arduino could even begin.

Paul

The first question is how will the robot know that it is not going in a straight line?

Common ways of doing that are by painting a line on the floor or using external light beacons that are used in the way a ship uses light houses to identify its position at sea.

If your robot is following a wall it could use an ultrasonic sensor to measure its distance from the wall.

...R