My team is currently testing out kitbots and bots from previous years, but we have encountered a really strange CPU lag issue where the following pattern emerges every time the robot is rebooted and restarted:

The CPU starts off at nearly zero, but gradually increases to 100%. This problem is causing a great lag for the robot. The most likely candidate for the lag issue is this:
Code:
void Adjust(float& left, float& right)
{
float difference = abs(abs(left) - abs(right));
if (difference < tolerance)
{
float average = (abs(left) + abs(right)) / 2;
if (left != 0)
left = average * (left / abs(left));
if (right != 0)
right = average * (right / abs(right));
}
left = left * left * left * left_sensitivity;
right = right * right * right * right_sensitivity;
if (left > 1)
left = 1;
else if (left < -1)
left = -1;
if (right > 1)
right = 1;
else if (right < -1)
right = -1;
}
even though I don't know how this would cause any lag.