...
const int pingPing = 7;
...
if (pingPing < 10) {
...
Seven is always going to be less than ten.
This bit reads the ping sensor:
long duration, inches;
pinMode(pingPing, OUTPUT);
digitalWrite(pingPing, LOW);
delayMicroseconds(2);
digitalWrite(pingPing, HIGH);
delayMicroseconds(5);
digitalWrite(pingPing, LOW);
pinMode(pingPing, INPUT);
duration = pulseIn(pingPing, HIGH);
inches = microsecondsToInches(duration);
It gives you two results, duration and inches. I suggest you modify your robotRight() function to take one of them as a parameter (inches is probably easier) then use that to determine what to do with the servo.