# Turtlebot ride backwards a specified distance

I want to write a python script that makes Turtlebot ride backwards for a specified distance in meters. I have this function

```
def ImuCallback(data, angle):
global stage
quat = data.orientation
q = [quat.x, quat.y, quat.z, quat.w]
roll, pitch, yaw = euler_from_quaternion(q)
sys.stdout.write("\r\033[1mGyro Angle\033[0m: [" + "{0:+.4f}".format(yaw) + " rad] ["\
+ "{0: >+7.2f}".format(degrees(yaw)) + " deg]"\
+ " \033[1mRate\033[0m: [" + "{0:+.4f}".format(data.angular_velocity.z) + " rad/s] ["\
+ "{0: >+7.2f}".format(degrees(data.angular_velocity.z)) + " deg/s] ")
if angle > 0:
if yaw > angle or yaw < 0:
stage += 1
else:
if yaw > angle and yaw < 0:
stage += 1
```

which makes it stop when the robot is rotating. I would like to read the distance travelled by the robot similarly as to how I read the angle of its rotation. I feel it has to be simple but I don't know how to do it. Thanks in advance!