Servo Motion


When confronted with a rail junction, the servo has a choice of which direction to go.
If there is an entry control instruction, it will go that way.
It will try to go in the direction pointed by set direction.
It prefers to go straight.
It tries to go in the direction it was moving previously (this makes it zig-zag). For example, if it reaches a T intersection after a left turn, it will go right.
If it can not go straight, then it will try to go up (relative to the servo).
Failing that, it will go randomly choose right, left, or down (again, relative to the servo).
It avoids going through a forbidding entry control; this is the second-to-last resort.
It won't go backwards unless it is at a dead-end.
Servos will not enter a rails if they have conflicting colors.