The solution is a bit strange.

The following code just gets distance 0 …Why do you add them?

```
// Get initial position
float x_0 = rosbot.get_position(1);
float y_0 = rosbot.get_position(2);
float x_1 = x_0;
float y_1 = y_0;
float dist = calc_distance(x_0, y_0, x_1, y_1);
```

To get out of the coffee shop, the final step slightly adjust the direction otherwise the robot will hit something on the way towards the exit because the turning is not 90 degrees and therefore the final trajectory is not straight. However, it is not practical (because all the parameters and the final turn and moving forward are added according to many experiments).

Is there any other way to achieve that?

```
while (dist < 8.00) {
// Update current position
x_1 = rosbot.get_position(1);
y_1 = rosbot.get_position(2);
dist = calc_distance(x_0, y_0, x_1, y_1);
ROS_INFO_STREAM("Distance travelled: " << dist);
// Keep moving
rosbot.move_forward(1);
}
rosbot.turn("clockwise", 3);
rosbot.move_forward(5);
ROS_INFO_STREAM("Success!!!");
```