public PIDSteeringWheelAngleRegulator(ICar car)
        {
            Car       = car;
            regulator = new PIDRegulator(new Settings(), "steering wheel angle regulator");

            car.evTargetSteeringWheelAngleChanged += new TargetSteeringWheelAngleChangedEventHandler(car_evTargetSteeringWheelAngleChanged);
            car.CarComunicator.evSteeringWheelAngleInfoReceived += new SteeringWheelAngleInfoReceivedEventHandler(CarComunicator_evSteeringWheelAngleInfoReceived);
        }
Example #2
0
        public PIDBrakeRegulator(ICar car)
        {
            ICar      = car;
            regulator = new PIDRegulator(new Settings(), "brake PID regulator");

            ICar.evTargetSpeedChanged += ICar_evTargetSpeedChanged;
            ICar.SpeedRegulator.evNewSpeedSettingCalculated += SpeedRegulator_evNewSpeedSettingCalculated;
            ICar.CarComunicator.evBrakePositionReceived     += CarComunicator_evBrakePositionReceived;
            evNewBrakeSettingCalculated += PIDBrakeRegulator_evNewBrakeSettingCalculated;
            ICar.evAlertBrake           += ICar_evAlertBrake;
        }
        public PIDBrakeRegulator(ICar car)
        {
            ICar = car;
            regulator = new PIDRegulator(new Settings(), "brake PID regulator");

            ICar.evTargetSpeedChanged += new TargetSpeedChangedEventHandler(ICar_evTargetSpeedChanged);
            ICar.SpeedRegulator.evNewSpeedSettingCalculated += new NewSpeedSettingCalculatedEventHandler(SpeedRegulator_evNewSpeedSettingCalculated);
            ICar.CarComunicator.evBrakePositionReceived += new BrakePositionReceivedEventHandler(CarComunicator_evBrakePositionReceived);
            evNewBrakeSettingCalculated += new NewBrakeSettingCalculatedEventHandler(PIDBrakeRegulator_evNewBrakeSettingCalculated);
            ICar.evAlertBrake += new EventHandler(ICar_evAlertBrake);
        }
Example #4
0
        public PIDSpeedRegulator(ICar parent)
        {
            Car            = parent;
            CarComunicator = parent.CarComunicator;

            regulator = new PIDRegulator(new Settings(), "speed PID regulator");

            Car.evAlertBrake                   += new EventHandler(Car_evAlertBrake);
            Car.evTargetSpeedChanged           += new TargetSpeedChangedEventHandler(Car_evTargetSpeedChanged);
            evNewSpeedSettingCalculated        += new NewSpeedSettingCalculatedEventHandler(PIDSpeedRegulator_evNewSpeedSettingCalculated);
            CarComunicator.evSpeedInfoReceived += new SpeedInfoReceivedEventHander(CarComunicator_evSpeedInfoReceived);
        }
        public PIDSpeedRegulator(ICar parent)
        {
            Car = parent;
            CarComunicator = parent.CarComunicator;

            regulator = new PIDRegulator(new Settings(), "speed PID regulator");

            Car.evAlertBrake += new EventHandler(Car_evAlertBrake);
            Car.evTargetSpeedChanged += new TargetSpeedChangedEventHandler(Car_evTargetSpeedChanged);
            evNewSpeedSettingCalculated += new NewSpeedSettingCalculatedEventHandler(PIDSpeedRegulator_evNewSpeedSettingCalculated);
            CarComunicator.evSpeedInfoReceived += new SpeedInfoReceivedEventHander(CarComunicator_evSpeedInfoReceived);
        }
Example #6
0
    /// <summary>
    /// Initialize servo.
    /// </summary>
    private void Awake()
    {
        if (Application.isPlaying)
        {
            correctedAxis     = GetCorrectedAxis();
            rigidbody         = GetComponent <Rigidbody>();
            positionRegulator = new PIDRegulator(positionRegulatorProfile);
            velocityRegulator = new PIDRegulator(velocityRegulatorProfile);

            CreateJoint();

            if (!profile || !positionRegulatorProfile)
            {
                Debug.Log("Servo " + name + " will not work properly, because it is not fully configured!");
            }
        }
    }
        public BarrelControlSystem(double dt) : base()
        {
            DT          = dt;
            InputStream = 0;

            InputStreamBlock  = new GainBlock(SystemSettings.Gain);
            m_withoutHitBlock = new AperiodicBlock(dt, SystemSettings.TForValve);

            var blocks = new Queue <IBlock>();

            blocks.Enqueue(new DelayBlock(dt, SystemSettings.Delay));
            blocks.Enqueue(new IntegralBlock(dt));
            blocks.Enqueue(new InterferenceBlock(SystemSettings.Interference));
            Object = new ComplexBlock(blocks);

            Regulator = new PIDRegulator(dt);
        }
Example #8
0
        public TankControlSystem(double dt) : base()
        {
            DT                = dt;
            Valve             = 0;
            InputStream       = SystemSettings.MaxInputStream;
            OutputStream      = SystemSettings.MaxOutputStream;
            OutputGain        = 0.2;
            m_withoutHitBlock = new AperiodicBlock(dt, SystemSettings.T);
            var blocks = new Queue <IBlock>();

            blocks.Enqueue(new DelayBlock(dt, SystemSettings.Delay));
            blocks.Enqueue(new AperiodicBlock(DT, SystemSettings.T));
            blocks.Enqueue(new GainBlock(SystemSettings.T));
            blocks.Enqueue(new InterferenceBlock(SystemSettings.Interference));
            Object    = new ComplexBlock(blocks);
            Regulator = new PIDRegulator(dt);
        }
Example #9
0
        public CarDriver(Map _baseMap, List <PositionAndOrientation> _track)
        {
            if (_track.Count < 2)
            {
                throw new ArgumentException();
            }
            if (_baseMap.car == null)
            {
                throw new ArgumentException();
            }

            baseMap                       = _baseMap;
            track                         = new LinkedList <PositionAndOrientation>(_track);
            distanceRegulator             = new PIDRegulator(distanceRegulatorSettings, "Car Driver distance regulator");
            distanceRegulator.targetValue = 0.0d;
            angleRegulator                = new PIDRegulator(angleRegulatorSettings, "Car Driver ANGLE regulator");
            angleRegulator.targetValue    = 0.0d;

            currentPosition = track.First;
        }