예제 #1
0
        private double ConvertReceivedBrakeAngleToRealBrakePosition(int value)
        {
            double val = Convert.ToDouble(value);

            if (Limiter.LimitAndReturnTrueIfLimitted(ref val, BRAKE_OUTPUT_MAX_PULLED, BRAKE_OUTPUT_MAX_PUSHED))
            {
                Logger.Log(this, "brake received value is out of range", 1);
            }
            return(ReScaller.ReScale(ref val, BRAKE_OUTPUT_MAX_PULLED, BRAKE_OUTPUT_MAX_PUSHED, BRAKE_POWER_WHEN_MAX_PULLED, BRAKE_POWER_WHEN_MAX_PUSHED));
        }
예제 #2
0
        private double ConvertReceivedSteeringWheelAngleToRealWheelAngle(int value)
        {
            double val = Convert.ToDouble(value);

            if (Limiter.LimitAndReturnTrueIfLimitted(ref val, WHEEL_ANGLE_ON_MAX_LEFT, WHEEL_ANGLE_ON_MAX_RIGHT))
            {
                Logger.Log(this, String.Format(
                               "Steering wheel received value - {0} - is out of range [{1},{2}]",
                               val,
                               WHEEL_OUTPUT_WHEN_MAX_LEFT,
                               WHEEL_OUTPUT_WHEN_MAX_RIGHT),
                           1);
            }
            return(ReScaller.ReScale(ref val, WHEEL_OUTPUT_WHEN_MAX_LEFT, WHEEL_OUTPUT_WHEN_MAX_RIGHT, WHEEL_ANGLE_ON_MAX_LEFT, WHEEL_ANGLE_ON_MAX_RIGHT));
        }
예제 #3
0
        private double ConvertReceivedSteeringWheelAngleToRealWheelAngle(int value)
        {
            double val = Convert.ToDouble(value);

            return(ReScaller.ReScale(ref val, WHEEL_OUTPUT_WHEN_MAX_LEFT, WHEEL_OUTPUT_WHEN_MAX_RIGHT, WHEEL_ANGLE_ON_MAX_LEFT, WHEEL_ANGLE_ON_MAX_RIGHT));
        }