function useEndEncoder(speedLeft, speedRight) {
                if (t.endEncoder == undefined) {
                    return;
                }
                var encoderDifference = {
                    left: t.endEncoder.left - t.encoder.left,
                    right: t.endEncoder.right - t.encoder.right
                };
                var stopEncoder = Math.abs(encoderDifference.left) < t.endEncoderSettings.maxAngleDifference &&
                    Math.abs(encoderDifference.right) < t.endEncoderSettings.maxAngleDifference &&
                    Math.abs(t.leftDrivingWheel.angularVelocity) < t.endEncoderSettings.maxAngularVelocity &&
                    Math.abs(t.rightDrivingWheel.angularVelocity) < t.endEncoderSettings.maxAngularVelocity;
                if (stopEncoder) {
                    // on end
                    t.endEncoder = undefined;
                    t.robotBehaviour.resetCommands();
                    t.needsNewCommands = true;
                }
                else {
                    var maxDifference = t.endEncoderSettings.maxForceControlEncoderDifference;
                    var dampingFactor = t.endEncoderSettings.encoderAngleDampingFactor;
                    t.leftForce = Util_1.Util.continuousSign(encoderDifference.left - t.leftDrivingWheel.angularVelocity * dampingFactor * dt, maxDifference) * Math.abs(speedLeft);
                    t.rightForce = Util_1.Util.continuousSign(encoderDifference.right - t.rightDrivingWheel.angularVelocity * dampingFactor * dt, maxDifference) * Math.abs(speedRight);
                }
            }
/**
             * Uses `encoder` to reach the values of `endEncoder` by setting the appropriate values
             *
             * @param speedLeft Use magnitude as maximum left speed (can be negative)
             * @param speedRight Use magnitude as maximum right speed (can be negative)
             */
Uses `encoder` to reach the values of `endEncoder` by setting the appropriate values
@param speedLeft Use magnitude as maximum left speed (can be negative)
@param speedRight Use magnitude as maximum right speed (can be negative)
Uses ` encoder ` to reach the values of ` endEncoder ` by setting the appropriate values @param speedLeft Use magnitude as maximum left speed ( can be negative ) @param speedRight Use magnitude as maximum right speed ( can be negative )
function useEndEncoder(speedLeft, speedRight) {
                if (t.endEncoder == undefined) {
                    return;
                }
                var encoderDifference = {
                    left: t.endEncoder.left - t.encoder.left,
                    right: t.endEncoder.right - t.encoder.right
                };
                var stopEncoder = Math.abs(encoderDifference.left) < t.endEncoderSettings.maxAngleDifference &&
                    Math.abs(encoderDifference.right) < t.endEncoderSettings.maxAngleDifference &&
                    Math.abs(t.leftDrivingWheel.angularVelocity) < t.endEncoderSettings.maxAngularVelocity &&
                    Math.abs(t.rightDrivingWheel.angularVelocity) < t.endEncoderSettings.maxAngularVelocity;
                if (stopEncoder) {
                    t.endEncoder = undefined;
                    t.robotBehaviour.resetCommands();
                    t.needsNewCommands = true;
                }
                else {
                    var maxDifference = t.endEncoderSettings.maxForceControlEncoderDifference;
                    var dampingFactor = t.endEncoderSettings.encoderAngleDampingFactor;
                    t.leftForce = Util_1.Util.continuousSign(encoderDifference.left - t.leftDrivingWheel.angularVelocity * dampingFactor * dt, maxDifference) * Math.abs(speedLeft);
                    t.rightForce = Util_1.Util.continuousSign(encoderDifference.right - t.rightDrivingWheel.angularVelocity * dampingFactor * dt, maxDifference) * Math.abs(speedRight);
                }
            }
function useEndEncoder ( speedLeft , speedRight ) { if ( t . endEncoder == undefined ) { return ; } var encoderDifference = { left : t . endEncoder . left - t . encoder . left , right : t . endEncoder . right - t . encoder . right } ; var stopEncoder = Math . abs ( encoderDifference . left ) < t . endEncoderSettings . maxAngleDifference && Math . abs ( encoderDifference . right ) < t . endEncoderSettings . maxAngleDifference && Math . abs ( t . leftDrivingWheel . angularVelocity ) < t . endEncoderSettings . maxAngularVelocity && Math . abs ( t . rightDrivingWheel . angularVelocity ) < t . endEncoderSettings . maxAngularVelocity ; if ( stopEncoder ) { t . endEncoder = undefined ; t . robotBehaviour . resetCommands ( ) ; t . needsNewCommands = true ; } else { var maxDifference = t . endEncoderSettings . maxForceControlEncoderDifference ; var dampingFactor = t . endEncoderSettings . encoderAngleDampingFactor ; t . leftForce = Util_1 . Util . continuousSign ( encoderDifference . left - t . leftDrivingWheel . angularVelocity * dampingFactor * dt , maxDifference ) * Math . abs ( speedLeft ) ; t . rightForce = Util_1 . Util . continuousSign ( encoderDifference . right - t . rightDrivingWheel . angularVelocity * dampingFactor * dt , maxDifference ) * Math . abs ( speedRight ) ; } }
Uses `encoder` to reach the values of `endEncoder` by setting the appropriate values
 @param speedLeft Use magnitude as maximum left speed (can be negative)
 @param speedRight Use magnitude as maximum right speed (can be negative)
Uses ` encoder ` to reach the values of ` endEncoder ` by setting the appropriate values @param speedLeft Use magnitude as maximum left speed ( can be negative ) @param speedRight Use magnitude as maximum right speed ( can be negative )
// on end