Formula for decision making when in contact with an obstacle using Arduino
The algorithm mentioned in the blog uses a Fuzzy Logic Controller to perform obstacle avoidance. You can read up more on fuzzy logic here: https://www.calvin.edu/~pribeiro/othrlnks/Fuzzy/home.htm


  newMotorSPD_L = basicVelocity + urgMotor_L + (urgTurn_R/4) - (urgTurn_L/2) + 60;
  newMotorSPD_R = basicVelocity + urgMotor_R + (urgTurn_L/4) - (urgTurn_R/2) + 60;


Based on the code, the formula is basically made up of variables with different weight/ratio.

basicVelocity is the default moving velocity of the robot when there is no obstacle or wall detected.

urgMotor_L/urgMotor_R is the ouput of the controller for frontal object detection/avoidance by getting the difference between the left and right ultrasonic sensor.

(urgTurn_R/4) - (urgTurn_L/2) is probably the left/right bias?

+60 at the end is probably to offset the error of the motor. (Assuming all other variable are 0, the robot should be still at 60 for their case?) 

To simplify what the formula does, it can be shown using this graph: