Error in the code
From Talk:Fusion
Jump to navigation
Jump to search
Revision as of 15 September 2013 at 15:17.
This is the thread's initial revision.
This is the thread's initial revision.
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);