I think you shouldn’t call abs() for gError statement, since you need to know the sign of the error. You want to have something like this:
while(true)
{
double gError = angle - Inertial.rotation(deg);
if( abs(gError) < 3) // we will stop within 3 deg from target
{
break;
}
double speed = gError * Kp;
leftBack.spin(fwd, -speed, velocityUnits::pct);
...
}
leftBack(stop);
...