In most tracks, when a car takes a full lap, the total yaw angle steered is 360 (with the appropriate sign for clock/counter-clock wise tracks). But for example, in suzuka, which self-intersects itself, its zero. So automatize the computation of this number before the circuit preprocessor starts the computation, and feed it to the rotation constraint.