In the last part, you need to complete the three terms

of PID controller.

First, you calculate the proportional term, then

the integral term, and then the derivative term.

And then you combine all three terms along with their

gains to compute the appropriate angular velocity of the robot.

Last, the integral, the accumulated error and the

previous error are saved for the next time step.

Now, if you run this PID controller, you're going to get something

similar to the graph on the left, where the red dashed line

is the desired angle to the goal, and the blue line,

the blue solid line is the actual orientation of the robot.

And what you want to see is that the difference

between those two is minimized by the PID controller.

And the other thing you want to see is that your gains ensure that there is very

low overshoot and almost no osco, oscillations in the, in the output.

You can see there's a little bit,

but not too much.

And also the blue line almost perfectly matches up the red line.