Complete the code to calculate the proportional term in the PID controller.
proportional = [1] * errorThe proportional term is calculated by multiplying the proportional gain kp by the current error.
Complete the code to update the integral term by adding the current error multiplied by the time delta.
integral += [1] * errorThe integral term accumulates the error over time, so we multiply the error by the time delta dt before adding it.
Fix the error in calculating the derivative term which should be the change in error divided by the time delta.
derivative = (error - [1]) / dtThe derivative term measures how fast the error is changing, so we subtract the previous error from the current error.
Fill both blanks to compute the PID output by summing proportional, integral, and derivative terms multiplied by their gains.
output = kp * error + [1] + [2]
The PID output sums the proportional term, the integral term multiplied by ki, and the derivative term multiplied by kd.
Fill all three blanks to update the previous error, calculate the control signal, and apply it to the drone's pitch adjustment.
previous_error = [1] control_signal = kp * error + ki * integral + [2] pitch_adjustment = [3](control_signal)
We update previous_error with the current error, calculate the control signal including the derivative term multiplied by kd, and then apply the control signal using the apply_pitch function.
