Created a function that sets the value of the distance at which we will drive. This is the closest wall if there is one.