Error in the code
From Talk:Fusion
Jump to navigation
Jump to search
I think there is a mistake in your code. It seems you have switched from degrees to radians, but not switched all of the actual math.
setTurnRightRadians(e.getBearing()+90-40*movementDirection);
This should actually be
setTurnRightRadians(e.getBearingRadians() + Math.PI/2 - (Math.PI/4.5)*movementDirection);
or
setTurnRightRadians(Math.toRadians(e.getBearing() + 90 - 40*movementDirection);