By the way, if you do use a PID loop to control the velocities I think you can improve stability (ie overshooting) and probably even response time by using both feedback and feed-forward control.
Instead of sending this to the motors:
Code:
pwm_out = PID(e) // PID is your PID function, e is the speed error
send this:
Code:
pwm_out = guess(target_velocity) + PID(e)
The guess function takes your PID setpoint, the target velocity, and guesses what PWM output you need to reach that velocity. It doesn't have to be exact, but as long as you're close you can improve the performance of your PID loop. The guess function ideally ends up providing most of the output and the PID loop just makes small corrections.
By the way your straight drive code uses the same idea (both sides are fed throttle and the PID loop just makes small adjustments to keep them at the same speed).