Got a version of the equation working.
motorL = vLeft + kp error;
motorR = vRight - kp error;
This was the semi code Arthur provided in the lecture. I just completely missed it. And I couldn't put it in code the other day either. Sorry team.
Changes therefore are:
A kp variable to Core code.
Made the two equations above the main variable for motorL & motorR (instead of defining them earlier and then overwriting them which it was doing).
Remove the if statement for if error > 0 or error < 0 as when error is 0 now motor speed is just vLeft or vRight. As defined by the above equation.
Robot tested up to a speed of 40 (probably can go higher just need to change the kp too).
Moved the robot detection line to a 10th of the space infront of it. This was what was causing the robot to turn far too early and cut track. Now only the final corner is cut and not by much either.
Some testing has been done. Speed value of 40 and kp of 0.5 work quite well.
Created an excel spreadsheet of the testing up to 40 speed and kp 0.5.
Have let teammates working on completion know of the change.
Got a version of the equation working. motorL = vLeft + kp error; motorR = vRight - kp error; This was the semi code Arthur provided in the lecture. I just completely missed it. And I couldn't put it in code the other day either. Sorry team.
Changes therefore are:
Created an excel spreadsheet of the testing up to 40 speed and kp 0.5. Have let teammates working on completion know of the change.