public synchronized void updateTurn() { if( turnDistance < 0) { while( turnDistance < 0) { if( Math.abs(turnDistance) < turnVelocity ) { heading -= Math.toRadians(Math.abs(turnDistance)); turnDistance = 0; } else { heading -= Math.toRadians(turnVelocity); turnDistance += turnVelocity; } sleepForNow(); } } else { while( turnDistance > 0) { if( Math.abs(turnDistance) < turnVelocity ) { heading += Math.toRadians(Math.abs(turnDistance)); turnDistance = 0; } else { heading += Math.toRadians(turnVelocity); turnDistance -= turnVelocity; } sleepForNow(); } } }